| 188 | } |
| 189 | |
| 190 | int SocketClientUDP::get_local_port () |
| 191 | { |
| 192 | if (connect_socket == INVALID_SOCKET) |
| 193 | { |
| 194 | return (int)SocketClientUDPReturnCodes::CREATE_SOCKET_ERROR; |
| 195 | } |
| 196 | struct sockaddr_in sin_local; |
| 197 | memset (&sin_local, 0, sizeof (sin_local)); |
| 198 | socklen_t slen = (socklen_t)sizeof (sin_local); |
| 199 | if (getsockname (connect_socket, (struct sockaddr *)&sin_local, &slen) == 0) |
| 200 | { |
| 201 | return ntohs (sin_local.sin_port); |
| 202 | } |
| 203 | else |
| 204 | { |
| 205 | return -1; |
| 206 | } |
| 207 | } |
| 208 | |
| 209 | int SocketClientUDP::send (const char *data, int size) |
| 210 | { |
nothing calls this directly
no outgoing calls
no test coverage detected