MCPcopy Create free account
hub / github.com/DFHack/dfhack / readFullBuffer

Function readFullBuffer

library/RemoteClient.cpp:115–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113}
114
115bool readFullBuffer(CSimpleSocket *socket, void *buf, int size)
116{
117 if (!socket->IsSocketValid())
118 return false;
119
120 char *ptr = (char*)buf;
121 while (size > 0) {
122 int cnt = socket->Receive(size);
123 if (cnt <= 0)
124 return false;
125 memcpy(ptr, socket->GetData(), cnt);
126 ptr += cnt;
127 size -= cnt;
128 }
129
130 return true;
131}
132
133int RemoteClient::GetDefaultPort()
134{

Callers 3

connectMethod · 0.85
executeMethod · 0.85
threadFnMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected