>> 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); }
  }

Basically I have a process (running at "nice -20") just looping the above,
reading the UDP socket and writing to a TCP socket.  I can't think of how to
make this any faster.

I suppose I could increase the xmit buffer on the output TCP socket and the
receive buffer on the other end of the TCP connection.  Maybe it would be
better to put the output TCP socket in non-blocking mode, and store up
everything that couldn't be written in a local buffer.  That way I can use as
much memory as I want.

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

Reply via email to