realbasic-nug
[Top] [All Lists]

Re: Sockets in Carbon

To: REALbasic Network Users Group <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Sockets in Carbon
From: James Sentman <james at sentman dot com>
Date: Wed, 30 Jan 2002 23:54:43 -0500

James,

   I am having a similar problem with OS X sockets.

Do you know if there is an implicit Close being done when an Error event is received, i.e. should I not be doing a Close if I receive an error?

I know I also have the situation you mention, where I do a close on error and later another close during my socket cleanup. I'm definitely going to change it so only 1 close will ever get done, and see if things improve.

I am still wrestling with crashing problems and sockets. When I was closing the socket twice, in exactly the manner you describe, I could duplicate a crash in just a few minutes under load. Since I've removed all that stuff I can go sometimes for as long as a couple of hours but it still sometimes crashes in just a few minutes under load.

I am treating an error event as an explicit close. I could be wrong, but it seems to work fine to consider the socket closed once an error happens.

I haven't tried anything with DNS information. But I can certainly change all my connections to use the IP address for testing purposes. But isn't the lookup basically only done once for any given address and then cached by the system? Am I saving anything except that initial lookup by using the IP address?

Oh wait, as I think about this further, I'm doing all my testing here against a machine on my local network that I access by IP address only. So I dont think the DNS lookup is causing my crashes, but I can certainly cache that info and see what happens. I'm done screwing around in that code for tonight though.

When you remove the multiple closes you're going to lulled into a false sense of security because it will run much better than before. But as I've discovered, it may still die, so keep it running for a while before you decide it's fixed!

Thanks,
 James
--
_________________________________________________________________________
James Sentman <james at sentman dot com>                  http://www.sentman.com
  Enterprise server monitoring with:    http://whistleblower.sentman.com/


<Prev in Thread] Current Thread [Next in Thread>