------------------------------------------------------------------------------------------------------------------------------------
| 390 | } |
| 391 | //------------------------------------------------------------------------------------------------------------------------------------ |
| 392 | BOOL __stdcall spiSend(DWORD addrCount, SOCKADDR * *addrList, char *buf, DWORD bufLen) |
| 393 | { |
| 394 | // DropMessage(0, "spiSend %d", GetCurrentThreadId()); |
| 395 | |
| 396 | if(!addrCount) |
| 397 | return TRUE; |
| 398 | |
| 399 | if(addrCount > 1) |
| 400 | DropMessage(1, "spiSend, multicast not supported"); |
| 401 | |
| 402 | try |
| 403 | { |
| 404 | // support for 1 peer for now |
| 405 | SOCKADDR him = *(addrList[0]); |
| 406 | |
| 407 | // send packet over the network module |
| 408 | pluggedNetwork->sendAsyn(him, Util::MemoryFrame(buf, bufLen)); |
| 409 | |
| 410 | // debug |
| 411 | // DropMessage(0, "Sent storm packet %d bytes", bufLen); |
| 412 | // DropMessage(0, "S> %s", sprintfBytes(buf, bufLen)); |
| 413 | } |
| 414 | catch(GeneralException &e) |
| 415 | { |
| 416 | DropLastError("spiSend failed: %s", e.getMessage()); |
| 417 | return FALSE; |
| 418 | } |
| 419 | return TRUE; |
| 420 | } |
| 421 | //------------------------------------------------------------------------------------------------------------------------------------ |
| 422 | BOOL __stdcall spiReceive(SOCKADDR **senderPeer, char **data, DWORD *databytes) |
| 423 | { |
nothing calls this directly
no test coverage detected