| 319 | } |
| 320 | |
| 321 | bool ENetHost::InitSocket(const IpAddress& address) |
| 322 | { |
| 323 | if (!m_socket.Create(address.GetProtocol())) |
| 324 | return false; |
| 325 | |
| 326 | m_socket.EnableBlocking(false); |
| 327 | m_socket.EnableBroadcasting(true); |
| 328 | m_socket.SetReceiveBufferSize(ENetConstants::ENetHost_ReceiveBufferSize); |
| 329 | m_socket.SetSendBufferSize(ENetConstants::ENetHost_SendBufferSize); |
| 330 | |
| 331 | if (address.IsValid() && !address.IsLoopback()) |
| 332 | { |
| 333 | if (m_socket.Bind(address) != SocketState_Bound) |
| 334 | { |
| 335 | NazaraError("Failed to bind address " + address.ToString()); |
| 336 | return false; |
| 337 | } |
| 338 | } |
| 339 | |
| 340 | m_poller.RegisterSocket(m_socket, SocketPollEvent_Read); |
| 341 | |
| 342 | return true; |
| 343 | } |
| 344 | |
| 345 | void ENetHost::AddToDispatchQueue(ENetPeer* peer) |
| 346 | { |
nothing calls this directly
no test coverage detected