MCPcopy Create free account
hub / github.com/brainflow-dev/brainflow / set_timeout

Method set_timeout

src/utils/socket_client_udp.cpp:135–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

133}
134
135int SocketClientUDP::set_timeout (int num_seconds)
136{
137 if ((num_seconds < 1) || (num_seconds > 100))
138 {
139 return (int)SocketClientUDPReturnCodes::INVALID_ARGUMENT_ERROR;
140 }
141 if (connect_socket == INVALID_SOCKET)
142 {
143 return (int)SocketClientUDPReturnCodes::CREATE_SOCKET_ERROR;
144 }
145
146 DWORD timeout = 1000 * num_seconds;
147 setsockopt (connect_socket, SOL_SOCKET, SO_RCVTIMEO, (char *)&timeout, sizeof (timeout));
148 setsockopt (connect_socket, SOL_SOCKET, SO_SNDTIMEO, (char *)&timeout, sizeof (timeout));
149
150 return (int)SocketClientUDPReturnCodes::STATUS_OK;
151}
152
153int SocketClientUDP::bind ()
154{

Callers 1

prepare_sessionMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected