當前位置: 首頁>>代碼示例>>C++>>正文


C++ Connection函數代碼示例

本文整理匯總了C++中Connection函數的典型用法代碼示例。如果您正苦於以下問題:C++ Connection函數的具體用法?C++ Connection怎麽用?C++ Connection使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了Connection函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: group

std::vector<std::unique_ptr<Group> > Group::ConstructLoopbackMesh(
    size_t num_hosts) {

    // construct a group of num_hosts
    std::vector<std::unique_ptr<Group> > group(num_hosts);

    for (size_t i = 0; i < num_hosts; ++i) {
        group[i] = std::make_unique<Group>(i, num_hosts);
    }

    // construct a stream socket pair for (i,j) with i < j
    for (size_t i = 0; i != num_hosts; ++i) {
        for (size_t j = i + 1; j < num_hosts; ++j) {
            LOG << "doing Socket::CreatePair() for i=" << i << " j=" << j;

            std::pair<Socket, Socket> sp = Socket::CreatePair();

            group[i]->connections_[j] = Connection(std::move(sp.first));
            group[j]->connections_[i] = Connection(std::move(sp.second));

            group[i]->connections_[j].is_loopback_ = true;
            group[j]->connections_[i].is_loopback_ = true;
        }
    }

    return group;
}
開發者ID:ShauryaRawat,項目名稱:thrill,代碼行數:27,代碼來源:group.cpp

示例2: OstTraceFunctionEntry0

/**
Parses the PTPIP header, gets and validates that the packet type is correct 
and sets the value of the packet length.
@return Type The PTPIP packet type received ie event or cancel. In case of invalid type, it returns 0
*/   
TInt CPTPIPEventHandler::ParsePTPIPHeaderL()
	{
	OstTraceFunctionEntry0( CPTPIPEVENTHANDLER_PARSEPTPIPHEADERL_ENTRY );
	
	TUint32 type = Connection().ValidateAndSetEventPayloadL();
	iPTPPacketLength = Connection().EventContainer()->Uint32L(CPTPIPGenericContainer::EPacketLength);
	
	OstTraceFunctionExit0( CPTPIPEVENTHANDLER_PARSEPTPIPHEADERL_EXIT );
	return type;
	}
開發者ID:kuailexs,項目名稱:symbiandump-mw3,代碼行數:15,代碼來源:cptpipeventhandler.cpp

示例3: printf

void 
SkyBoxConnector::keyPress(char key)
{
	if(SCENE->camera->GetTarget() == (IGObject*)this->Connection())
	{
		if(key>='0' && key<'9')
		{
			if(lastKey!=key)
			{
				current=(key-48>=0 && key-48<=5)? key-48 : 6;
				printf("SKYBOX: sellected wall: %s\n", wallNames[current]);
			}
			lastKey=key;
		}
		else if(key=='l')
		{
			if(lastKey!='l')
			{
				((SkyBox*)Connection())->LoadeHightMap(files[currentSellection],bumpmapchannel,current>5? -1:current);
				if(++bumpmapchannel>3)
				bumpmapchannel=0; 
			}
			lastKey='l';
		}
		else if(key=='x')
		{
			if(lastKey!='x')
			{
				currentSellection=currentSellection==5?0:currentSellection+1;
				printf("Sellected Image: %s\n",files[currentSellection]);
			}
			lastKey='x';
		}
		else if(key=='r')
		{
			if(lastKey!='r')
			{
				((SkyBox*)Connection())->LoadeColorMap(files[currentSellection],current>5? -1:current);
			}
			lastKey='r';
		}
		else for(int i=0;i<6;i++)
		{
			current = i;
			vConnection()->Get<VoxControl>()->keyPress(key);
		}
	}
}
開發者ID:KallePower,項目名稱:AlphaKlang,代碼行數:48,代碼來源:SkyBox.cpp

示例4: BasicTest

static void BasicTest()
{
	// Replace this URL with your own URL:
	XmlRpcClient Connection("http://web.edval.com.au/rpc");
	Connection.setIgnoreCertificateAuthority();
	//Connection.setBasicAuth_Callback(PopUpAPrettyDialog);
	Connection.setBasicAuth_UsernameAndPassword("foo", "goo");

	//  Call:  arumate.getKilowatts(string, integer)   :
	XmlRpcValue args, result;
	args[0] = "test";
	args[1] = 1;

	// 
	double g = 3.14159;
	XmlRpcValue binary(&g, sizeof(g));
	args[2] = binary;
	XmlRpcValue::BinaryData bdata = binary;

	// Replace this function name with your own:
	if (! Connection.execute("getKilowatts", args, result)) {
		std::cout << Connection.getError();
	}
	else if (result.getType() == XmlRpcValue::TypeString)
		std::cout << result.GetStdString();
	else std::cout << "Success\n";
}
開發者ID:drtimcooper,項目名稱:XmlRpc4Win,代碼行數:27,代碼來源:SampleMain.cpp

示例5:

Neuron::Neuron(unsigned numberOutputs, unsigned index,  const string &transferFunction) {
    for (unsigned c = 0; c < numberOutputs; c++) {
        outputWeights.push_back(Connection());
    }
    this->index=index;
    this->transferFunction=transferFunction;
}
開發者ID:jizhihang,項目名稱:neuralNet,代碼行數:7,代碼來源:neuron.cpp

示例6: Connection

void ConnectionManager::addConnection(SIN& addr) {
	std::map<SIN, Connection>::iterator it;
	if ((it = conn_map.find(addr)) == conn_map.end())
		conn_map.insert(ConnectionRecord(addr, Connection(parent, *this, addr)));
	else
		throw CONN_DUP;
}
開發者ID:williamd4112,項目名稱:NPP_HW2,代碼行數:7,代碼來源:connection.cpp

示例7: Enum

const std::vector<std::string> Environment::ScanPorts() const
{
    std::vector<std::string> validNames;
    std::string portName;

    for(unsigned int i = 1; i < 17; i++)
    {
        portName = "Com";
        portName.append( boost::lexical_cast<std::string>(i));
        #ifdef SERIALCONNECTION_DEBUG
            std::cout << "Trying port name: " << portName << "...";
        #endif // SERIALCONNECTION_DEBUG
        SerialDeviceEnumeration Enum(portName, 9600);
        SerialConnection Connection(io_service, Enum);
        if( !Connection.Connect() )
        {
            #ifdef SERIALCONNECTION_DEBUG
                std::cout << "valid.\n";
            #endif // SERIALCONNECTION_DEBUG
            validNames.push_back(portName);
        }
        else
        {
            #ifdef SERIALCONNECTION_DEBUG
                std::cout << "invalid.\n";
            #endif // SERIALCONNECTION_DEBUG
        }
        Connection.Disconnect();
    }
    return validNames;
}
開發者ID:MLPaladin888,項目名稱:DataPlotter,代碼行數:31,代碼來源:Environment.cpp

示例8: Connection

Connection Signal<_Res (_ArgTypes...), Combiner>::connect(const SlotType& _slot)
{
  auto newConnectionBody = std::make_shared<ConnectionBodyType>(_slot);
  mConnectionBodies.insert(newConnectionBody);

  return Connection(std::move(newConnectionBody));
}
開發者ID:erwincoumans,項目名稱:dart,代碼行數:7,代碼來源:Signal.hpp

示例9: NETLIST_OBJECT

void SCH_TEXT::GetNetListItem( NETLIST_OBJECT_LIST& aNetListItems,
                               SCH_SHEET_PATH*      aSheetPath )
{
    if( GetLayer() == LAYER_NOTES || GetLayer() == LAYER_SHEETLABEL )
        return;

    NETLIST_OBJECT* item = new NETLIST_OBJECT();
    item->m_SheetPath = *aSheetPath;
    item->m_SheetPathInclude = *aSheetPath;
    item->m_Comp = (SCH_ITEM*) this;
    item->m_Type = NET_LABEL;

    if( GetLayer() == LAYER_GLOBLABEL )
        item->m_Type = NET_GLOBLABEL;
    else if( GetLayer() == LAYER_HIERLABEL )
        item->m_Type = NET_HIERLABEL;

    item->m_Label = m_Text;
    item->m_Start = item->m_End = GetTextPos();

    aNetListItems.push_back( item );

    // If a bus connects to label
    if( Connection( *aSheetPath )->IsBusLabel( m_Text ) )
    {
        item->ConvertBusToNetListItems( aNetListItems );
    }
}
開發者ID:johnbeard,項目名稱:kicad,代碼行數:28,代碼來源:sch_text.cpp

示例10: main

int main(int argc, char *argv[])
{
    int sock, x = 0;
    char *Path = argv[1], *Pro_Sea = argv[2], *Host = argv[3];

    puts("[+] NsT-phpBBDoS v0.1 by HaCkZaTaN");
    puts("[+] NeoSecurityTeam");
    puts("[+] Dos has begun....[+]\n");
    fflush(stdout);

    if(argc != 4) Use(argv[0]);

    while(1)
    {
           sock = Connection(Host,80);
           Write_In(sock, Path, Pro_Sea, Host, x);
           #ifndef WIN32
           shutdown(sock, SHUT_WR);
           close(sock);
           #else
           closesocket(sock);
           WSACleanup();
           #endif
           Pro_Sea = argv[2];
           x++;
    }
    //I don't think that it will get here =) 

    return 0;
}
開發者ID:0x24bin,項目名稱:exploit-database,代碼行數:30,代碼來源:1064.c

示例11: MOZ_ASSERT

nsresult
TLSFilterTransaction::ReadSegments(nsAHttpSegmentReader *aReader,
                                   uint32_t aCount, uint32_t *outCountRead)
{
  MOZ_ASSERT(PR_GetCurrentThread() == gSocketThread);
  LOG(("TLSFilterTransaction::ReadSegments %p max=%d\n", this, aCount));

  if (!mTransaction) {
    return NS_ERROR_UNEXPECTED;
  }

  mReadSegmentBlocked = false;
  mSegmentReader = aReader;
  nsresult rv = mTransaction->ReadSegments(this, aCount, outCountRead);
  LOG(("TLSFilterTransaction %p called trans->ReadSegments rv=%x %d\n",
       this, rv, *outCountRead));
  if (NS_SUCCEEDED(rv) && mReadSegmentBlocked) {
    rv = NS_BASE_STREAM_WOULD_BLOCK;
    LOG(("TLSFilterTransaction %p read segment blocked found rv=%x\n",
         this, rv));
    Connection()->ForceSend();
  }

  return rv;
}
開發者ID:ashishrana7,項目名稱:firefox,代碼行數:25,代碼來源:TunnelUtils.cpp

示例12: disconnecT

/******************************************************************************
* Disconnect from the timer. The timer is stopped if no longer needed.
*/
void SynchTimer::disconnecT(QObject* receiver, const char* member)
{
    if (mTimer)
    {
        mTimer->disconnect(receiver, member);
        if (member)
        {
            int i = mConnections.indexOf(Connection(receiver, member));
            if (i >= 0)
                mConnections.removeAt(i);
        }
        else
        {
            for (int i = 0;  i < mConnections.count();  )
            {
                if (mConnections[i].receiver == receiver)
                    mConnections.removeAt(i);
                else
                    ++i;
            }
        }
        if (mConnections.isEmpty())
        {
            mTimer->disconnect();
            mTimer->stop();
        }
    }
}
開發者ID:chusopr,項目名稱:kdepim-ktimetracker-akonadi,代碼行數:31,代碼來源:synchtimer.cpp

示例13: req

/**
Sends a response to the initiator.
@param aCode MTP response code
*/
void CMTPGetObjectPropsSupported::SendResponseL(TUint16 aCode)
    {
    const TMTPTypeRequest& req(Request());
    iResponse.SetUint16(TMTPTypeResponse::EResponseCode, aCode);
    iResponse.SetUint32(TMTPTypeResponse::EResponseSessionID, req.Uint32(TMTPTypeRequest::ERequestSessionID));
    iResponse.SetUint32(TMTPTypeResponse::EResponseTransactionID, req.Uint32(TMTPTypeRequest::ERequestTransactionID));
    iFramework.SendResponseL(iResponse, req, Connection());
    }
開發者ID:kuailexs,項目名稱:symbiandump-mw3,代碼行數:12,代碼來源:cmtpgetobjectpropssupported.cpp

示例14: Connection

bool MysqlCon::CheckConnection()
{
	if (NULL == m_mysql)
	{
		return Connection();
	}
	return m_isConnect;
}
開發者ID:czfsvn,項目名稱:LinuxC,代碼行數:8,代碼來源:MysqlCon.cpp

示例15: randomWeight

Neuron::Neuron(unsigned numOutputs, unsigned myIndex)
{
    for (unsigned c = 0; c < numOutputs; ++c) {
        m_outputWeights.push_back(Connection());
        m_outputWeights.back().weight = randomWeight();
    }

    m_myIndex = myIndex;
}
開發者ID:NullCodex,項目名稱:EnviroSim,代碼行數:9,代碼來源:Neuron.cpp


注:本文中的Connection函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。