コード例 #1
0
ファイル: Packet.cpp プロジェクト: Noxalus/YAPOG
  bool Packet::CreateFromSocket (ClientSocket& socket)
  {
    if (!socket.Receive (*this))
      return false;

    type_ = ReadPacketType ();

    return true;
  }
コード例 #2
0
void *ProcessReceive(void *arg)
{
    string  receiveMessage;
    ClientSocket *clientSocket = static_cast<ClientSocket *>(arg);
    while(!value_receive_exit){
        clientSocket->Receive(receiveMessage);
        if(receiveMessage == ""){
               continue;
        }
        cout << "Response from server: "<< receiveMessage << endl;
        if(receiveMessage == "server has received your file"){
              value_send_exit = 1;
              break;
        }
        //cout << "Response from server: "<< receiveMessage << endl;
        sleep(2);
    }
    pthread_exit(NULL);
    return NULL;
}