MCPcopy Create free account
hub / github.com/GarageGames/Torque2D / checkLookup

Method checkLookup

engine/source/platform/platformNetAsync.cpp:165–194  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165bool NetAsync::checkLookup(NetSocket socket, void* out_h_addr,
166 int* out_h_length, int out_h_addr_size)
167{
168 lockNetAsyncMutex();
169 bool found = false;
170 // search for the socket
171 Vector<NameLookupRequest*>::iterator iter;
172 for (iter = mLookupRequests.begin();
173 iter != mLookupRequests.end();
174 ++iter)
175 // if we found it and it is complete...
176 if (socket == (*iter)->sock && (*iter)->complete)
177 {
178 // copy the lookup data to the callers parameters
179 dMemcpy(out_h_addr, (*iter)->out_h_addr, out_h_addr_size);
180 *out_h_length = (*iter)->out_h_length;
181 found = true;
182 break;
183 }
184
185 // we found the socket, so we are done with it. erase.
186 if (found)
187 {
188 delete *iter;
189 mLookupRequests.erase(iter);
190 }
191 unlockNetAsyncMutex();
192
193 return found;
194}
195
196// this is called by the pthread module to start the thread
197static void StartThreadFunc(S32 nothing)

Callers 1

processMethod · 0.80

Calls 6

lockNetAsyncMutexFunction · 0.85
unlockNetAsyncMutexFunction · 0.85
dMemcpyFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected