Connect

プロパティを読み取って、設定値を決定し、サーバーへの接続を確立します。HTTP、HTTPS、またはソケットを介して接続できます。

注: C++ では、HTTP、HTTPS、またはソケット サーバー接続プロトコルを使用します。HTTP と HTTPS は、クライアント接続を論理的に確立するだけで、GetService メソッドまたは Process メソッドが呼び出されるまで実際にはサーバーに接続しません。ソケット プロトコルは、Connect が呼び出された時点でサーバーへの接続を確立します。

構文

void connect() 

パラメータ

なし

結果

サーバーへのクライアント接続を確立します。

//Create Server 
SmartPointer<Server> server =new Server(); 

//Set server connection properties 
server->setConnectionProperty(Server::HOST,"localhost"); 
server->setConnectionProperty(Server::PORT, "10119"); 
server->setConnectionProperty(Server::CONNECTION_TYPE , "SOCKET"); 
server->setConnectionProperty(Server::ACCOUNT_ID, "guest"); 
server->setConnectionProperty(Server::ACCOUNT_PASSWORD, ""); 

//Connect to server 
server->connect();