本文整理汇总了C++中CClientSocket::ISCThread方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientSocket::ISCThread方法的具体用法?C++ CClientSocket::ISCThread怎么用?C++ CClientSocket::ISCThread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClientSocket
的用法示例。
在下文中一共展示了CClientSocket::ISCThread方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HandleClients
// Handle all our clients
void CServerSocket::HandleClients( fd_set* fds )
{
for(UINT i=0;i<ClientList.size( );i++)
{
CClientSocket* client = ClientList.at( i );
if(!client->isActive)
continue;
if(FD_ISSET( client->sock, fds ))
{
if (client->isserver == true)
{
//Log( MSG_INFO,"ISC PACKET");
if(!client->ISCThread()){
client->isActive = false;
DisconnectClient( client );}
}
else
if(!client->ReceiveData( ) )
{
client->isActive = false;
DisconnectClient( client );
}
}
}
}
示例2: ClientMainThread
// Handle client socket (threads)
PVOID ClientMainThread( PVOID ClientSocket )
{
CClientSocket* thisplayer = (CClientSocket*) ClientSocket;
fd_set fds;
while(thisplayer->isActive)
{
FD_ZERO(&fds);
FD_SET (thisplayer->sock, &fds);
int Select = select( thisplayer->sock+1, &fds, NULL, NULL, NULL );
if(Select == SOCKET_ERROR)
{
Log( MSG_ERROR,NULL,"Error in Select");
thisplayer->isActive = false;
}
else
{
if(FD_ISSET( thisplayer->sock, &fds ))
{
if (thisplayer->isserver == true)
{
//Log( MSG_INFO,"ISC PACKET");
thisplayer->ISCThread();
}
else
if(!thisplayer->ReceiveData( ))
{
thisplayer->isActive = false;
}
}
}
}
thisplayer->GS->DisconnectClient( thisplayer );
pthread_exit(NULL);
return 0 ;
}