document.write('
Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. void NetworkManager::Update(NetMSG i_netMSG)
  2.                 {
  3.                     if(m_connected)
  4.                     {
  5.                         if(server)
  6.                         {
  7.                             int size = sizeof(i_netMSG);
  8.                             memmove(buffer, &i_netMSG, sizeof(i_netMSG));
  9.                             //after connection send n receive data
  10.                             iResult = send( ClientSocket, buffer, sizeof(i_netMSG), 0);
  11.  
  12.                             if(iResult == SOCKET_ERROR)
  13.                             {
  14.                                 printf("send failed with error: %d\\n", buffer, iResult);
  15.                                 closesocket(ClientSocket);
  16.                                 WSACleanup();
  17.                                 return;
  18.                             }
  19.                         }
  20.  
  21.                         else if(!server)
  22.                         {
  23.                             memmove(sendbuf, &i_netMSG, sizeof(i_netMSG));
  24.                             //after connection send n receive data
  25.                             iResult = send( ConnectSocket, sendbuf, sizeof(i_netMSG), 0);
  26.  
  27.                             if(iResult == SOCKET_ERROR)
  28.                             {
  29.                                 printf("send failed with error: %d\\n", sendbuf, iResult);
  30.                                 closesocket(ConnectSocket);
  31.                                 WSACleanup();
  32.                                 return;
  33.                             }
  34.                         }
  35.                     }
  36.                 }
');