MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / Receive

Method Receive

src/network/network_client.cpp:199–211  ·  view source on GitHub ↗

* 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 */

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 3

CanSendReceiveMethod · 0.80
ClientErrorMethod · 0.80
ReceivePacketsMethod · 0.45

Tested by

no test coverage detected