void RedirectorSrv::server_sockevent( nlink_server *cptr, uint16 revents, void *myNet ) { NetworkInterface * client; struct nlink_client *ncptr; if(revents & PF_READ) { client = ( ( NetworkInterface * ) myNet )->getConnection( ); if (!client) return; uint32 nonblockingstate = true; IOCTL_SOCKET( client->getSocketID(), IOCTL_NOBLOCK, &nonblockingstate ); ncptr = new nlink_client; if(ncptr == NULL) return; memset(ncptr, 0, sizeof(*ncptr)); ncptr->hdr.type = RCLIENT; ncptr->hdr.fd = client->getSocketID(); nlink_insert((struct nlink *)ncptr); Client *pClient = new Client(); pClient->BindNI(client); ncptr->pClient = pClient; pClient->getNetwork()->sendData( mDestination.length( ), mDestination.c_str( ) ); Log::getSingleton( ).outString( "REDIRECTOR: Sent world server" ); disconnect_client( ncptr ); } }