if( !uoSocket->socket()->isOpen() )
if( uoSocket->socket()->status() != IO_Ok )
int main( int argc, char** argv ){	cListener* listener = new cListener(2593);	netio = new cAsyncNetIO;	listener->start();	netio->start();	try	{		while ( true )		{			if ( listener->haveNewConnection() )			{				QSocketDevice *socket = listener->getNewConnection(); 				netio->registerSocket( socket );				uoSockets.push_back( new cUOSocket(socket) );				cout << QString( "Socket connected [%1]\n" ).arg( socket->peerAddress().toString() ).latin1();			}			// Process waiting packets			vector< cUOSocket* >::iterator uoIterator;			for( uoIterator = uoSockets.begin(); uoIterator != uoSockets.end(); ++uoIterator )			{				cUOSocket *uoSocket = (*uoIterator);				if( !uoSocket->socket()->isOpen() )				{					cout << QString( "Socket disconnected [%1]\n" ).arg( uoSocket->socket()->peerAddress().toString() ).latin1();					netio->unregisterSocket( uoSocket->socket() );					uoSockets.erase( uoIterator );				}				else				{					uoSocket->recieve();				}			}			_sleep( 40 );		}	}	catch( Synchronization_Exception& e )	{		cerr << e.what() << endl;		netio->cancel();		listener->cancel();	}	catch ( ... )	{		cerr << "Unknown exception" << endl;		terminate();	}	return 0;}