cmdriver/src/CMDriver.cxx
//--------------------------------------------------------------------------------------------
// This function will run every time the new client try to connect to the editor
// It will create socket connection between the client and the currently 
// running pmod server and will start client log.
//--------------------------------------------------------------------------------------------
This function will run every time the new client try to connect to the editor
It will create socket connection between the client and the currently
running pmod server and will start client log.
This function will run every time the new client try to connect to the editor It will create socket connection between the client and the currently running pmod server and will start client log .
void ConnectClient(int client_socket, sockaddr *addr, int client_type) {
    static int ID_Counter = 0;
    int client_port = ((sockaddr_in *)addr)->sin_port;
    int client_tcp  = ntohl(((sockaddr_in *)addr)->sin_addr.s_addr);
    ClientDescriptor* client = CreateNewClient(ID_Counter,
                                               client_socket,
                                               client_port,
                                               client_tcp,
                                               client_type);
    char *str = client->getDescription();
    if(str != NULL) {
        _DBG(fprintf(log_fd, "  New client connected: %s.\n", str));
    } else {
        _DBG(fprintf(log_fd, "  New client connected.\n"));
    }
    ID_Counter++;
}
void ConnectClient ( int client_socket , sockaddr * addr , int client_type ) { static int ID_Counter = 0 ; int client_port = ( ( sockaddr_in * ) addr ) -> sin_port ; int client_tcp = ntohl ( ( ( sockaddr_in * ) addr ) -> sin_addr . s_addr ) ; ClientDescriptor * client = CreateNewClient ( ID_Counter , client_socket , client_port , client_tcp , client_type ) ; char * str = client -> getDescription ( ) ; if ( str != NULL ) { _DBG ( fprintf ( log_fd , " \n " , str ) ) ; } else { _DBG ( fprintf ( log_fd , " \n " ) ) ; } ID_Counter ++ ; }
This function will run every time the new client try to connect to the editor
It will create socket connection between the client and the currently
running pmod server and will start client log.
This function will run every time the new client try to connect to the editor It will create socket connection between the client and the currently running pmod server and will start client log .
// We will not use password right now, but we may in future