Changes between Version 11 and Version 12 of Docs/Prog/Manual/DeviceSupport/Network
- Timestamp:
- 04/29/11 09:46:34 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Docs/Prog/Manual/DeviceSupport/Network
v11 v12 385 385 struct hostent *svr; 386 386 char buffer[50], rcv_buf[50]; 387 int sockfd, n, i, flags,rcv_pos = 0;387 int sockfd, n, i, rcv_pos = 0; 388 388 RcvMode rcvMode = rcvIdle; 389 389 … … 413 413 } 414 414 415 // Set the socket to be non-blocking 416 if (-1 == (flags = fcntl(sockfd, F_GETFL, 0))) 417 { 418 flags = 0; 419 } 420 fcntl(sockfd, F_SETFL, flags | O_NONBLOCK); 415 // Set the socket to be non-blocking 416 if (fcntl(sockfd, F_SETFL, O_NONBLOCK) == -1) 417 { 418 printf("fcntl: unable to set non-blocking\r\n"); 419 } 421 420 422 421 printf("Connected to server %s port %d waiting for message from server\r\n", IP_ADDR, IP_PORT);