| 572 | } |
| 573 | |
| 574 | void Net::shutdown() |
| 575 | { |
| 576 | Process::remove(&Net::process); |
| 577 | |
| 578 | #ifdef TORQUE_NET_CURL |
| 579 | HTTPObject::shutdown(); |
| 580 | #endif |
| 581 | |
| 582 | while (gPolledSockets.size() > 0) |
| 583 | { |
| 584 | if (gPolledSockets[0] == NULL) |
| 585 | gPolledSockets.erase(gPolledSockets.begin()); |
| 586 | else |
| 587 | closeConnectTo(gPolledSockets[0]->handleFd); |
| 588 | } |
| 589 | |
| 590 | closePort(); |
| 591 | PlatformNetState::initCount--; |
| 592 | |
| 593 | // Destroy event handlers |
| 594 | delete smConnectionNotify; |
| 595 | delete smConnectionAccept; |
| 596 | delete smConnectionReceive; |
| 597 | delete smPacketReceive; |
| 598 | |
| 599 | #if defined(TORQUE_USE_WINSOCK) |
| 600 | if(!PlatformNetState::initCount) |
| 601 | { |
| 602 | WSACleanup(); |
| 603 | } |
| 604 | #endif |
| 605 | } |
| 606 | |
| 607 | // ipv4 version of name routines |
| 608 | |