Find the answer to your Linux question:
Results 1 to 3 of 3
CWBool CWNetworkSendUnsafeConnected(CWSocket sock, const char *buf, int len) { if(buf == NULL) return CWErrorRaise(CW_ERROR_WRONG_ARG, NULL); while(send(sock, buf, len, 0) < 0) { if(errno == EINTR) continue; CWNetworkRaiseSystemError(CW_ERROR_SENDING); } return CW_TRUE; ...
  1. #1
    kdg
    kdg is offline
    Just Joined!
    Join Date
    Aug 2009
    Posts
    5

    new to linux.....plz help

    CWBool CWNetworkSendUnsafeConnected(CWSocket sock, const char *buf, int len) {

    if(buf == NULL)
    return CWErrorRaise(CW_ERROR_WRONG_ARG, NULL);

    while(send(sock, buf, len, 0) < 0) {

    if(errno == EINTR) continue;
    CWNetworkRaiseSystemError(CW_ERROR_SENDING);
    }
    return CW_TRUE;
    }

    I am new to linux programming......can any body tell me what does the send(sock,buf,len,0) function do in the above code snippet ?

  2. #2
    Linux Newbie
    Join Date
    Jan 2008
    Location
    Canada
    Posts
    109
    Quote Originally Posted by kdg View Post
    CWBool CWNetworkSendUnsafeConnected(CWSocket sock, const char *buf, int len) {

    if(buf == NULL)
    return CWErrorRaise(CW_ERROR_WRONG_ARG, NULL);

    while(send(sock, buf, len, 0) < 0) {

    if(errno == EINTR) continue;
    CWNetworkRaiseSystemError(CW_ERROR_SENDING);
    }
    return CW_TRUE;
    }

    I am new to linux programming......can any body tell me what does the send(sock,buf,len,0) function do in the above code snippet ?
    Hi
    The send command ia a system function which sends a message to a socket. Look at 'man send' for more details. Cheers...
    Robert

  3. #3
    kdg
    kdg is offline
    Just Joined!
    Join Date
    Aug 2009
    Posts
    5
    Hi Robert,
    Thnx for the help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...