Changes between Version 11 and Version 12 of Docs/Prog/Manual/DeviceSupport/Network


Ignore:
Timestamp:
04/29/11 09:46:34 (13 years ago)
Author:
travis_l
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Docs/Prog/Manual/DeviceSupport/Network

    v11 v12  
    385385        struct hostent *svr;
    386386        char buffer[50], rcv_buf[50];
    387         int sockfd, n, i, flags, rcv_pos = 0;
     387        int sockfd, n, i, rcv_pos = 0;
    388388        RcvMode rcvMode = rcvIdle;
    389389
     
    413413        }
    414414
    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        }
    421420
    422421        printf("Connected to server %s port %d waiting for message from server\r\n", IP_ADDR, IP_PORT);