| 137 | } |
| 138 | |
| 139 | bool NetAsync::checkLookup(NetSocket socket, void* out_h_addr, |
| 140 | S32* out_h_length, S32 out_h_addr_size) |
| 141 | { |
| 142 | bool found = false; |
| 143 | |
| 144 | // search for the socket |
| 145 | RequestIterator iter; |
| 146 | for (iter = mLookupRequests.begin(); |
| 147 | iter != mLookupRequests.end(); |
| 148 | ++iter) |
| 149 | // if we found it and it is complete... |
| 150 | if (socket == iter->sock && iter->complete) |
| 151 | { |
| 152 | // copy the lookup data to the callers parameters |
| 153 | dMemcpy(out_h_addr, iter->out_h_addr, out_h_addr_size); |
| 154 | *out_h_length = iter->out_h_length; |
| 155 | found = true; |
| 156 | break; |
| 157 | } |
| 158 | |
| 159 | // we found the socket, so we are done with it. erase. |
| 160 | if (found) |
| 161 | mLookupRequests.erase(iter); |
| 162 | |
| 163 | return found; |
| 164 | } |