| 163 | } |
| 164 | |
| 165 | bool NetAsync::checkLookup(NetSocket socket, void* out_h_addr, |
| 166 | S32* out_h_length, S32 out_h_addr_size) |
| 167 | { |
| 168 | bool found = false; |
| 169 | |
| 170 | // search for the socket |
| 171 | RequestIterator 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 | mLookupRequests.erase(iter); |
| 188 | |
| 189 | return found; |
| 190 | } |