| 545 | } |
| 546 | |
| 547 | bool Net::init() |
| 548 | { |
| 549 | #if defined(TORQUE_USE_WINSOCK) |
| 550 | if(!PlatformNetState::initCount) |
| 551 | { |
| 552 | WSADATA stWSAData; |
| 553 | AssertISV( !WSAStartup( 0x0101, &stWSAData ), "Net::init - failed to init WinSock!" ); |
| 554 | |
| 555 | //logprintf("Winsock initialization %s", success ? "succeeded." : "failed!"); |
| 556 | } |
| 557 | #endif |
| 558 | PlatformNetState::initCount++; |
| 559 | |
| 560 | smConnectionNotify = new ConnectionNotifyEvent(); |
| 561 | smConnectionAccept = new ConnectionAcceptedEvent(); |
| 562 | smConnectionReceive = new ConnectionReceiveEvent(); |
| 563 | smPacketReceive = new PacketReceiveEvent(); |
| 564 | |
| 565 | #ifdef TORQUE_NET_CURL |
| 566 | HTTPObject::init(); |
| 567 | #endif |
| 568 | |
| 569 | Process::notify(&Net::process, PROCESS_NET_ORDER); |
| 570 | |
| 571 | return(true); |
| 572 | } |
| 573 | |
| 574 | void Net::shutdown() |
| 575 | { |