home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.protocols.tcp-ip      TCP and IP network protocols.      14,669 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 12,883 of 14,669   
   reppisch to All   
   maximum allowable buffer size for send()   
   27 May 09 16:48:09   
   
   From: spam@reppisch.de   
      
   Hi Ng,   
      
   i hope thi is the right group.   
   I have some questions concerning the socket-api:   
      
   1) Is there a maximum allowable buffersize which may be presented to   
   send() on a nonblocking connected tcp socket (AF_INET, SOCK_STREAM)?   
      
   I experience strange lock-ups on older systems when submitting more than   
   64k in one call.   
      
   2) strange problem:  select() doesn't wake up   
      
   'sock' is a connected tcp-socket. Data transfer runs ok for some time   
   and occasionally locks up or remains a long time in the following   
   situation:   
   The client is waiting in a blocking read.   
   The sender is waiting on select(read,write,null,...) where read and   
   write fdsets contain (amongst others) the 'sock'.   
   The select sleeps until timeout (1 sek) is reached. The receive-function   
   in the client is still blocking.   
   Since the receiver read all data, i'd expect select to signal the socket   
   'writeable'.   
   Select, receive and send are done in one thread for all of my connections.   
   The first argument to select is the highest socket number in all of the   
   fdsets seen +1.   
      
   q: Is it allowed to have the same socket in read and write-fdset? It should!   
   q: Is it allowed to use the same socket from different threads? (in   
   blocking and nonblocking mode).   
   - for receive,send,select?   
      
   I think multiple threads working with the same socket is at least not a   
   good idea...   
      
      
   btw. What is this except-fdset anyway? I never noticed it firing. (I'm   
   not using OOB-Data.)   
      
   3) Is there some kind of load balancing between sockets guaranteed?   
   I.e. we have two connected sockets, both signaled writeable.  When   
   sending to the buffers in a fixed order, will the stack ensure that the   
   first send won't eat up all transfer capacity? It should!   
      
   4) unsymmetric tranfer rates for up/downstream   
   Does anybody know iperf?  (sourceforge.net/projects/iperf)   
   In a switched fullduplex 100MBit Eth, Iperf gives me very unsymmetric   
   results for up/downstream  when testing up and downstream simultaneously   
     (-d option) Results vary from 10/5 ... 10/0,1. Again protocol is TCP.   
      
   If the tests are performed in sequence, everything ist ok (10/10).   
      
   When setting a send / recv buffersize on socket level   
   "setsockopt( sock, SOL_SOCKET, SO_SNDBUF ..." of about 65k everything is   
   symmetric, even in the simutaneous upstream/downstream test (8/8).   
      
   OS'es are RHEL5,kernel 2.6.18 / W2k   
      
   Ps:   
   send() is called with MSG_NOSIGNAL, so sigpipe shouldn't be raised. I'v   
   installed a signal handler for SIGPIPE anayway (simply ignoring it).   
      
   pps:   
   Yes i checked network gear between the machines. I even tried a direct   
   connection via a crossed cable...   
      
   Regards,   
      Michael   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca