libs/nameserver/src/nameServCalls.cxx
// Function connects to name server and registers specified service
// name - service name
// port - service port
// returns 1 on success
// returns -1 if unable to connect to name server
Function connects to name server and registers specified service
name - service name
port - service port
returns 1 on success
returns -1 if unable to connect to name server
Function connects to name server and registers specified service name - service name port - service port returns 1 on success returns - 1 if unable to connect to name server
int NameServerRegisterService(const char *name, int port)
{
    int sock  = ConnectToNameServer();
    if(sock < 0)
	return -1;
    if(!SendCommand(sock, REGISTER_SERVER))
	return -1;
    if(!SendInteger(sock, port)){
	closesocket(sock);
	return -1;
    }
    if(!SendInteger(sock, strlen(name))) {
	closesocket(sock);
	return -1;
    }
    if(!SendBuffer(sock, name, strlen(name))) {
	closesocket(sock);
	return -1;
    }
    closesocket(sock);
    return 1;
}
int NameServerRegisterService ( const char * name , int port ) { int sock = ConnectToNameServer ( ) ; if ( sock < 0 ) return -1 ; if ( ! SendCommand ( sock , REGISTER_SERVER ) ) return -1 ; if ( ! SendInteger ( sock , port ) ) { closesocket ( sock ) ; return -1 ; } if ( ! SendInteger ( sock , strlen ( name ) ) ) { closesocket ( sock ) ; return -1 ; } if ( ! SendBuffer ( sock , name , strlen ( name ) ) ) { closesocket ( sock ) ; return -1 ; } closesocket ( sock ) ; return 1 ; }
Function connects to name server and registers specified service
name - service name
port - service port
returns 1 on success
returns -1 if unable to connect to name server
Function connects to name server and registers specified service name - service name port - service port returns 1 on success returns - 1 if unable to connect to name server