serverspy/src/serverspy.cxx
//------------------------------------------------------------------------------
// This function will try to connect to the existing model server.
//------------------------------------------------------------------------------
This function will try to connect to the existing model server.
This function will try to connect to the existing model server .
int ConnectToModelServer(void) {
int model_socket;
    model_socket = create_socket();
    if (model_socket< 0) return -1;
    int tmp_switch = 1;
    setsockopt(model_socket, IPPROTO_TCP, TCP_NODELAY, (char *)&tmp_switch, sizeof(tmp_switch));
    if(connect(model_socket,(struct sockaddr *)&model_connection_descriptor, sizeof (sockaddr_in)) < 0) {
        return -1;
    }
    return model_socket;
}
int ConnectToModelServer ( void ) { int model_socket ; model_socket = create_socket ( ) ; if ( model_socket < 0 ) return -1 ; int tmp_switch = 1 ; setsockopt ( model_socket , IPPROTO_TCP , TCP_NODELAY , ( char * ) & tmp_switch , sizeof ( tmp_switch ) ) ; if ( connect ( model_socket , ( struct sockaddr * ) & model_connection_descriptor , sizeof ( sockaddr_in ) ) < 0 ) { return -1 ; } return model_socket ; }
This function will try to connect to the existing model server.
This function will try to connect to the existing model server .
// Create the connection-oriented socket // Try to get connection. We will use model_socket_name global  // data structure which will contain up-to-date information about  // model server. This information is filled every time the server  // starts or during recovery procedure.