0

I have one C application that hosts server. The task for server is to send byte stream of huge data over socket to the client. Client is able to connect successfully to the server.

Now Server is able to send data to the client, but after some time server close its own socket. So my C application is not able to send data to the client over socket. When i tried to print error using perror () function I am getting error as "Connection reset by peer" and "Pipe broken". My C application is not closing socket through system call.

So My question is that, who is responsible for closing this server socket? Is there any size limit that socket can send at time? Is there any timeout?

What I have observed that this issue is weird and has no relation with size or timeout. But I am not able to understand why this server socket is getting closed.

Any help or advise? Thanks in advance.

John Bollinger
  • 160,171
  • 8
  • 81
  • 157
Parth Shah
  • 65
  • 5
  • have a look at [this](http://stackoverflow.com/questions/4584904/what-causes-the-broken-pipe-error) answer. – Sourav Ghosh Oct 29 '14 at 14:05
  • 2
    We cannot possibly advise you about details of your program's behavior without considering the relevant code. Your issue might be related to the kind of socket, socket options, host or network environment, client behavior, or any number of other things. – John Bollinger Oct 29 '14 at 14:57
  • does your code do any sort of waiting between sending data? it could be a timeout on the server side causing it to close the connection. – Rocky Pulley Oct 29 '14 at 15:01
  • The message indicates the client closed the connection. – user3629249 Oct 30 '14 at 00:35
  • @TritonMan yes my application waits for 500ms between sending data. – Parth Shah Oct 30 '14 at 05:28

0 Answers0