MCPcopy Create free account
hub / github.com/bwapi/bwapi / bind

Method bind

bwapi/SNP_DirectIP/SNP/UDPSocket.cpp:51–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void UDPSocket::bind(int port)
52{
53 if(!_s)
54 return;
55 sockaddr_in service;
56 service.sin_family = AF_INET;
57 service.sin_addr.s_addr = htonl(INADDR_ANY);
58 service.sin_port = htons(port);
59 if(::bind(_s, (sockaddr*)&service, sizeof(service)) == SOCKET_ERROR)
60 {
61 throw GeneralException("::bind failed");
62 }
63 _bound = port;
64}
65
66void UDPSocket::sendPacket(const UDPAddr &target, Util::MemoryFrame data)
67{

Callers 1

rebindFunction · 0.80

Calls 1

GeneralExceptionClass · 0.85

Tested by

no test coverage detected