[prev in list] [next in list] [prev in thread] [next in thread] 

List:       twsocket
Subject:    Re: [twsocket] Multithreaded server not triggering
From:       "Francois PIETTE" <francois.piette () skynet ! be>
Date:       2011-08-15 6:03:55
Message-ID: BEC77765B708492CACDDD994939E2B2C () Z600
[Download RAW message or body]

> I've been forced down the Multi-threaded server route as I'm using a 
> client's
> API that only works when on its own connection thread.

What kind of client API ?

> Everything has been working fine except for an issue I get that when
> the PC is busy with multiple connections, some new connections
> don't fire the SessionAvailable event so I'm not aware of the connection.

I'll assume you are using TWSocketServer. Does it run in the mainthread or 
in a secondary thread ?
If events are not triggered, then something is using all cpu or blocking 
within the thread which runs TWSocketServer, or the corresponding message 
pump is blocked. Since you are multithreading, first look for interthread 
locking (WaitForSomthing API, CriticalSection API, Synchronize and such).

> SysInternals ProcessExplorer reports the connections as established
> but there's no way I can access them.

So connections has been accepted. SessionAvailable should trigger.

> The problem is that the client has no timeout so remains connected
> permanently. Even when I stop the server from listening the connect 
> remains open.

Stopping to listen never break any existing connection ! Estalished 
connections have their own socket independant of the listening socket.

> Has anyone has a similar issue?

Only when multithreading or windows meessaging rules are not respected.

> Is there a way I can get a list of active sockets talking to my app 
> similar to ProcessExplorer?

TWSocketServer has an array property with a refernce to all connected 
sockets: Client[].


francois.piette@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be 

--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic