Jump to content
  • Advertisement
Sign in to follow this  
wood_brian

Linux/Tcp Question

This topic is 2900 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

As you may know, I'm using a three-tier architecture:

C++ Middleware Writer (CMW) -- a service

C++ Middleware Writer Ambassador (CMWA)-- a service

"direct" program -- runs once and exits

I'm testing some error handling functionality in the CMWA if the CMW crashes. I've added a sleep to my version of the CMW so that it delays the first user request by a minute so I have time to start one or more instances of the direct program and kill the CMW before the sleep ends. If there's just one instance of the direct program running, things seems to work as expected. But when I have two instances of direct, rather than a read() returning zero, it returns a negative value and ernno is ECONNRESET. I'm running all of the processes on a machine running Fedora 13. Does anyone know why the behaviour is different between the two cases? When I get a zero return I throw an "eof" exception. I'm wondering if I should check for the ECONNRESET value and also throw an eof exception in that case. Thanks in advance.

Brian Wood
Ebenezer Enterprises
http://webEbenezer.net

Share this post


Link to post
Share on other sites
Advertisement
Could you write a sequence list of events?

0) process A starts
1) process A calls bind() on port X and listen() and accept()
2) process A returns from accept()
3) process B starts
4) process B calls bind() on port Y and listen() and accept()
5) process C starts
...

I don't understand what the actual problem is from your description.

Share this post


Link to post
Share on other sites

I don't understand what the actual problem is from your description.



Sorry for my not so clear initial post. I've been thinking about it a little more and have one idea. When I just run one instance of the direct program, all of the data from the user's request is delivered via tcp to the CMW by the time it hits the sleep. But when I run two instances, there's data (from the second request) that hasn't been delivered from tcp to the CMW before I kill the CMW. I guess this may have something to do with the difference I'm noticing.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!