[EMAIL PROTECTED] wrote:
> 
> >> 3. What other tunings can I make to help UDP receive performance?
> 
> Alan> Making your code faster is one. What is it actualyl doing with the
> Alan> captured data ?
> 
> I send it directly to another process, then repeat.
> 
> This is the main loop in the process that reads the UDP packets:
> 
>   for (;;) {
>     n = recvfrom(sockfd, mesg, MAXMESG, 0, pcli_addr, &maxclilen);
>     if (n <= 0) { fprintf(stderr, "listener: recvfrom err %d", n); exit (-1); }
>     n = write(outputfd, mesg, n);
>     if (n <= 0) { fprintf(stderr, "write err %d", n); exit (-1); }
>   }

You may want to consider the case where write() succeeds but
only writes part of the data.  And then, you may not.
(Also, write() returning zero does not neccessarily indicate an error).
        -Dan

-- 
Dan A. Dickey
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to [EMAIL PROTECTED]

Reply via email to