Connect

Reads the properties to determine the configuration settings and makes a connection to the server. You can connect via HTTP, HTTPS, or SOCKET.

Note: C++ uses the HTTP, HTTPS, or SOCKET server connection protocol. HTTP and HTTPS logically establish a client connection but do not actually connect to the server until a GetService or Process method is invoked. The SOCKET protocol establishes a connection to the server when Connect is invoked.

Syntax

void connect() 

Parameters

None.

Results

Establishes client connection to the server.

Example

//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();