MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / nw_Receive

Function nw_Receive

networking/networking.cpp:942–961  ·  view source on GitHub ↗

nw_Recieve will call the above function to read data out of the socket. It will then determine which of the buffers we should use and pass to the routine which called us

Source from the content-addressed store, hash-verified

940// nw_Recieve will call the above function to read data out of the socket. It will then determine
941// which of the buffers we should use and pass to the routine which called us
942int nw_Receive(void *data, network_address *from_addr) {
943 // call the routine to read data out of the socket (which stuffs it into the packet buffers)
944
945 if (Use_DirectPlay) {
946#ifdef WIN32
947 dp_DirectPlayDispatch();
948#endif
949 } else {
950 // nw_ReceiveFromSocket();
951 nw_DoReceiveCallbacks();
952 }
953
954 int buffer_size;
955
956 // try and get a free buffer and return its size
957 if (nw_psnet_buffer_get_next((uint8_t *)data, &buffer_size, from_addr)) {
958 return buffer_size;
959 }
960 return 0;
961}
962
963int ExtraBufferTempHack = 0;
964// Temp hack to figure out this buffer overflow thing

Callers 7

MultiProcessIncomingFunction · 0.85
AskToJoinFunction · 0.85
MultiPollForLevelInfoFunction · 0.85
SearchForLocalGamesTCPFunction · 0.85
SearchForGamesPXOFunction · 0.85
msn_GetURLFunction · 0.85

Calls 3

dp_DirectPlayDispatchFunction · 0.85
nw_DoReceiveCallbacksFunction · 0.85
nw_psnet_buffer_get_nextFunction · 0.85

Tested by

no test coverage detected