Changeset 1a0fb3f8 in mainline for uspace/srv/net/socket/socket_client.c
- Timestamp:
- 2010-01-04T22:47:30Z (16 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ede63e4
- Parents:
- b648ae4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/socket/socket_client.c
rb648ae4 r1a0fb3f8 71 71 #define SOCKET_MAX_ACCEPTED_SIZE 0 72 72 73 /** Default timeout for connections in microseconds. 74 */ 75 #define SOCKET_CONNECT_TIMEOUT ( 1 * 1000 * 1000 ) 76 73 77 /** Type definition of the socket specific data. 74 78 * @see socket … … 180 184 * Connects to the TCP module if necessary. 181 185 * @returns The TCP module phone. 186 * @returns Other error codes as defined for the bind_service_timeout() function. 182 187 */ 183 188 static int socket_get_tcp_phone( void ); … … 186 191 * Connects to the UDP module if necessary. 187 192 * @returns The UDP module phone. 193 * @returns Other error codes as defined for the bind_service_timeout() function. 188 194 */ 189 195 static int socket_get_udp_phone( void ); … … 262 268 static int socket_get_tcp_phone( void ){ 263 269 if( socket_globals.tcp_phone < 0 ){ 264 socket_globals.tcp_phone = bind_service ( SERVICE_TCP, 0, 0, SERVICE_TCP, socket_connection);270 socket_globals.tcp_phone = bind_service_timeout( SERVICE_TCP, 0, 0, SERVICE_TCP, socket_connection, SOCKET_CONNECT_TIMEOUT ); 265 271 } 266 272 return socket_globals.tcp_phone; … … 269 275 static int socket_get_udp_phone( void ){ 270 276 if( socket_globals.udp_phone < 0 ){ 271 socket_globals.udp_phone = bind_service ( SERVICE_UDP, 0, 0, SERVICE_UDP, socket_connection);277 socket_globals.udp_phone = bind_service_timeout( SERVICE_UDP, 0, 0, SERVICE_UDP, socket_connection, SOCKET_CONNECT_TIMEOUT ); 272 278 } 273 279 return socket_globals.udp_phone; … … 426 432 return EPFNOSUPPORT; 427 433 } 434 if( phone < 0 ) return phone; 428 435 // create a new socket structure 429 436 socket = ( socket_ref ) malloc( sizeof( socket_t ));
Note:
See TracChangeset
for help on using the changeset viewer.