* Check whether we received/can send some data from/to the server and * when that's the case handle it appropriately. * @return true when everything went okay. */ static */
| 197 | * @return true when everything went okay. |
| 198 | */ |
| 199 | /* static */ bool ClientNetworkGameSocketHandler::Receive() |
| 200 | { |
| 201 | if (my_client->CanSendReceive()) { |
| 202 | NetworkRecvStatus res = my_client->ReceivePackets(); |
| 203 | if (res != NETWORK_RECV_STATUS_OKAY) { |
| 204 | /* The client made an error of which we can not recover. |
| 205 | * Close the connection and drop back to the main menu. */ |
| 206 | my_client->ClientError(res); |
| 207 | return false; |
| 208 | } |
| 209 | } |
| 210 | return _networking; |
| 211 | } |
| 212 | |
| 213 | /** Send the packets of this socket handler. */ |
| 214 | /* static */ void ClientNetworkGameSocketHandler::Send() |
nothing calls this directly
no test coverage detected