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


Ignore:
Timestamp:
04/29/11 09:43:40 (14 years ago)
Author:
travis_l
Comment:

--

Legend:

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

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