Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!crackers!m2c!wpi.WPI.EDU!sclayton From: sclayton@wpi.WPI.EDU (Shawn A Clayton) Newsgroups: comp.protocols.tcp-ip Subject: Problems with TCP, read(), and write() Message-ID: <1991Mar30.174657.28200@wpi.WPI.EDU> Date: 30 Mar 91 17:46:57 GMT Sender: sclayton@wpi.WPI.EDU (Shawn A Clayton) Organization: Worcester Polytechnic Institute Lines: 22 I am having problems with TCP, write(), and read(). I want to send and receive 32 byte structures. The sockets used are of the type SOCK_STREAM, and I write() 32 byte chunks into one end (after connect()ing) and attempt to read() 32 byte chunks from the other end (after listen()ing and accept()ing). I write and read many of these 32 byte structures in succession. My problem is that if I do no put a sizeable delay in the send or receive loop, I end up receiving only part of a 32 byte chunk after a number of chunks have been received. There is no problem if I put in a large (the larger the better) delay before each write() or read(). I do not use the )_NDELAY or O_NONBLOCK options. Sometimes it will work with a given delay, and other times it does not. I seems to fail less the longer the delay is, and more the less the delay. It also fails more if the total number of chunks I attempt to send is increased. Below about fourty of these chunks there is no problem. Can anyone help me? What am I doing wrong? I would appreciate any comments or suggestions on what may be screwing this up. Please email me - Thanks - Shawn sclayton@ee.wpi.edu ----------------------------------------------------------------------- No, I don't have a signature line!