SetConnectionProperty

Establishes the server connection configuration properties, such as host name and length of timeout.

Syntax

ASCII Version
int setConnectionProperty(Server* server, const char* name, const char* value) 
Unicode Version
int setConnectionProperty(Server* server, const UChar* name, const UChar* value) 

Parameters

  • Server — the server to which the client connects
  • Name — the name of the connection property, such as HOST
  • Value — the value for the name of the connection property, such as "www.myhost.com"

Result

Returns 0 (if successful) or error code.

Example

ASCII Version
int nRet; 
Server *server = NULL; 
nRet = createServer(&server); 
nRet = setConnectionProperty(server, SERVER_HOST, 
"localhost");
Unicode Version
int nRet; 
// construct 16-bit string 
UChar serverHost[32]; 
char* SERVER_HOST= SERVER_HOST; 
u_charsToUChars(SERVER_HOST,	serverHost,	strlen(SERVER_HOST)); 
serverHost [ strlen(SERVER_HOST)]=0;	
// construct 16-bit string 
UChar hostValue [32]; 
char* value= "localhost"; 
u_charsToUChars(value,	hostValue,	strlen(value)); 
hostValue[ strlen(value)]=0;	
nRet = setConnectionProperty(server, serverHost	, hostValue);