当前位置: 首页>>代码示例>>C++>>正文


C++ CClientSocket::ReceiveData方法代码示例

本文整理汇总了C++中CClientSocket::ReceiveData方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientSocket::ReceiveData方法的具体用法?C++ CClientSocket::ReceiveData怎么用?C++ CClientSocket::ReceiveData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CClientSocket的用法示例。


在下文中一共展示了CClientSocket::ReceiveData方法的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 ); 
			}
		}
	}  
}
开发者ID:RavenX8,项目名称:osirose,代码行数:26,代码来源:SocketServer.cpp

示例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 ;
}
开发者ID:L3nn0x,项目名称:osirosenew,代码行数:37,代码来源:SocketClient.cpp


注:本文中的CClientSocket::ReceiveData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。