![]() |
| | #1 |
| Registered User Join Date: Mar 2004
Posts: 13
| recv() I connect to the server ok, can send requests ok. The problem is when I try to recv(). The main program deals with the send()ing stuff, I have fork()ed a new process to sit and recv() responses from the server. The program breaks after it has recieved one responce. I am using the same file descriptor for both send() and recv(), could this be the problem? The error message is: recv: Connection reset by peer Any help would be appreciated, Cheers |
| afisher is offline | |
| | #2 |
| C++ Developer Join Date: Jun 2002 Location: UWaterloo
Posts: 2,718
| Most of us aren't telepathic (not sure about Prelude and Salem), so it would help if you showed some code.
__________________ Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie |
| XSquared is offline | |
| | #3 |
| B26354 Join Date: Jan 2002
Posts: 631
| Based on the information you've provided, it appears the server is disconnecting from you after sending the response (much like an HTTP server).
__________________ Jason Deckard |
| Deckard is offline | |
| | #4 |
| End Of Line Join Date: Apr 2002
Posts: 6,240
| @afisher: Are we talking about a web server here? Assuming we are... >>The program breaks after it has recieved one responce. What was the response? If it was a good response (eg a web page), then your connection is possibly being closed because you didn't set the http keep-alive header. If it was a bad response, or simply no data at all, then your request was probably bad in the first place.
__________________ When all else fails, read the instructions. If you're posting code, use code tags: [code] /* insert code here */ [/code] |
| Hammer is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| recv() returns 0 the second time | Overlord | Networking/Device Communication | 7 | 07-10-2009 04:09 AM |
| Question about recv | carrotcake1029 | Networking/Device Communication | 2 | 02-26-2009 02:10 PM |
| recv() problem | Massive | C Programming | 5 | 06-26-2003 04:58 AM |
| non blocking recv | rohit | Linux Programming | 4 | 03-05-2002 09:35 PM |
| recv function (blocking) | aurumice | Linux Programming | 0 | 03-01-2002 01:19 AM |