Socket problem, streaming data

Socket problem, streaming data

Post by Antti Innama » Fri, 14 Mar 2003 19:46:23

Hi All,

I'm trying to write a client-server application to stream data from one
platform to the other using blocking sockets. For some reason after one
cycle of sending to (send()) and receiving from (recv()) data from the
server, the client application must reconnect the socket (using calls to
socket() and connect()) before more data can be transmitted between the two.
Otherwise the server application perrors with "recv: Connection reset by
peer". My understanding is that once a socket is open, you should be able to
send and receive data until the the socket is closed or the application

Any help is appreaciated, I'm stuck with this one!
Antti Innamaa


Socket problem, streaming data

Post by Steven Rosted » Sat, 15 Mar 2003 06:26:54

I just wrote a small program to test what you are stating and I had
no problems. Show some code, because you might be closing a socket
descriptor without realizing it.

-- Steve


1. TCPIP Stream Socket losing data - Solaris 2.3

We are running two processes on a single machine, communicating via
TCPIP stream sockets.  From time to time a binary file is transfered
between these processes.  Periodically 1 byte of the binary file will
not be transferred.  This is not totally consistent, but will happen
about 19 out of twenty times with one particular binary file when I
set breakpoints in the receiving process.  The data byte lost in this
file is always at the same point and is a newline.  For a test I
replaced all newlines in this binary file with nulls, and the dropped
byte happened less frequently.  In this new file when the byte was dropped
it was at a different location in the file and was a carriage return.

I have tried both writes and sends at the sending process and both
recv and read at the receiving process.  I have determined that the
data is there when the buffer is passed to the write or send and is
not there when the recv or read gets it.  I have searched the SunSolve
database, but the patches I found did not seem to be relevant.

Any help on this would be greatly appreciated.

My current patches are

watt(503): showrev -p
Patch: 101316-01  Obsoletes:   Packages: SUNWarc.2 11.5.0,REV=2.0.18,PATCH=1, SUNWcsu.2 11.5.0,REV=2.0.18,PATCH=2
Patch: 101317-09  Obsoletes:   Packages: SUNWlpr.2 11.5.0,REV=2.0.18,PATCH=9, SUNWlpu.2 11.5.0,REV=2.0.18,PATCH=9, SUNWscpu.2 11.5.0,REV=2.0.18,PATCH=12
Patch: 101318-45  Obsoletes: 101294-02,101267-01,101326-01,101349-01,101319-02,101346-03,101485-01,101411-04  Packages: SUNWarc.3 11.5.0,REV=2.0.18,PATCH=68, SUNWcar.2 11.5.0,REV=2.0.18,PATCH=61, SUNWcsr.2 11.5.0,REV=2.0.19,PATCH=98, SUNWcsu.4 11.5.0,REV=2.0.18,PATCH=140, SUNWdfb.2 11.5.0,REV=2.0.18,PATCH=39, SUNWsxr.2 11.5.0,REV=2.0.18,PATCH=39
Patch: 101362-11  Obsoletes: 101307-01 101457-01  Packages: SUNWowrqd.2 3.3.19,REV=,PATCH=46
Patch: 101409-03  Obsoletes:   Packages: SUNWcsu.3 11.5.0,REV=2.0.18,PATCH=76, SUNWtoo.2 11.5.0,REV=2.0.18,PATCH=3
Patch: 101327-06  Obsoletes:   Packages: SUNWcsu.5 11.5.0,REV=2.0.18,PATCH=137
Patch: 101329-15  Obsoletes: 101315-01  Packages: SUNWarc.4 11.5.0,REV=2.0.18,PATCH=65, SUNWcsr.3 11.5.0,REV=2.0.19,PATCH=93, SUNWcsu.6 11.5.0,REV=2.0.18,PATCH=133, SUNWnisu.2 11.5.0,REV=2.0.18,PATCH=15
Patch: 101331-03  Obsoletes:   Packages: SUNWcsu.7 11.5.0,REV=2.0.18,PATCH=35
Patch: 101344-08  Obsoletes:   Packages: SUNWcsr.4 11.5.0,REV=2.0.19,PATCH=108, SUNWcsu.8 11.5.0,REV=2.0.18,PATCH=157
Patch: 101347-01  Obsoletes:   Packages: SUNWcsr.5 11.5.0,REV=2.0.19,PATCH=10
Patch: 101406-01  Obsoletes:   Packages: SUNWcsr.6 11.5.0,REV=2.0.19,PATCH=26
Patch: 101615-02  Obsoletes:   Packages: SUNWcsu.9 11.5.0,REV=2.0.18,PATCH=161, SUNWscpu.3 11.5.0,REV=2.0.18,PATCH=13
Patch: 101533-03  Obsoletes:   Packages: SUNWowMIT.2 3.3.18,REV=,PATCH=3



2. alpha 164 and mvi instructions

3. Socket Stream 4K data limit.

4. Linux Laptop

5. maximum receiving data in stream socket

6. NetBSD 1.3 sun3x && floppy MAJ/MIN

7. How to push STREAMS module into socket stream

8. How to find out a file is open by others?

9. Netscape/Java streaming data problem (stock quotes)

10. Problems applying oss437a: Streams Lock Timeout and Protocol Data

11. Stream sockets problems ?

12. Stream socket client/server connection problems

13. PROBLEM RESOLUTION: sockets: Out of streams resources