gettingstarted
[Top] [All Lists]

Re: linux console app and server sockets

To: "evLSiN" <evlsin at gmail dot com>, "Getting Started" <gettingstarted at lists dot realsoftware dot com>
Subject: Re: linux console app and server sockets
From: "Aaron Ballman" <aaron at realsoftware dot com>
Date: Sun, 29 Aug 2004 21:21:13 -0500
Cc:
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <b374cece0408291915732aa1c3 at mail dot gmail dot com>
> I am trying to build a very basic chat server console app. Not overly
> complicated you would think. I have it built and it runs, but as soon
> as AddSocket() is called for the fourth time the app crashes and
> returns a NilObjectException... I am at a loss as to why it waits for
> the fourth connection.... here is a transcript of my debug output:

I am going to guess that you have a control array of sockets on the window
that you are using to pass back in your AddSocket event (or something
similar) and that you're getting out of bounds exceptions and hence passing
nil back in that event.  Of course, without code, this is just
speculation...

Don't try to keep track of the sockets by keeping them in a pre-allocated
array.  If you must keep track of them, append them to the array from the
AddSocket event since that event can (and will!) get called an arbitrary
number of times.

In any case, it would help to see the AddSocket code to diagnose what the
true problem is.

~Aaron

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

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