Re: [twsocket] Question about twsocketthrdserver

2012-04-09 Thread Arno Garrels
Tony Caduto wrote:
 Hi,
 I have a chat server is ported from synapse and I used
 twsocketthrdserver so it would scale with 200 sockets per thread. The
 problem is in my original server i used a generic tdictionary to
 store pointers to the client objects. I use a critical section to
 protect the tdictionary and this all works great except when I go
 over 200 connections,  then when a user sends a message to a user in
 the 2nd thread one of them dies,  the 2nd thread does not terminate
 but it's like the message pump dies. 
 I use the protected tdictionary to locate the recipient socket object.
 
 The thread list and the client list are private and I can't make use
 of them in the stock component.
 
 Anyone have any ideas on what may be going on?

Access to the protected TDictonary object is thread-safe, however 
it is not calling methods and access properties of the client objects.
You have to communicate with the clients using Window messages.
Look at how TWSocketThrdClient defines a new message ID and overrides
its WndProc method.

BTW: I just checked in some fixes of OverbyteIcsWSocketTS.pas
some 64-bit and one message pump fix.

-- 
Arno   
--
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


Re: [twsocket] Question about twsocketthrdserver

2012-04-09 Thread Arno Garrels
Arno Garrels wrote:
 Access to the protected TDictonary object is thread-safe, however
 it is not calling methods and access properties of the client objects.
 You have to communicate with the clients using Window messages.
 Look at how TWSocketThrdClient defines a new message ID and overrides
 its WndProc method.

And even that won't be safe. If, for instance, the client has been 
detached from its thread, that is its Handle property is zero, and you call
PostMessage(Client.Handle..) the handle will be recreated in the context
of the calling thread, which will likely cause an error when the component
finally destroys the Handle in main thread context.

Bottomline: Do not use this class if you ever need to access client objects
from outside their own event handlers. Instead TWSocketServer should be used,
do lengthy, blocking tasks in a worker thread.

-- 
Arno
--
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


Re: [twsocket] Question about twsocketthrdserver

2012-04-09 Thread Tony Caduto
I'm just doing a sendline after finding the client object in the
tdictionary, doesn't a send just put the data in the buffer? I even put the
sendline in the critical section and one of the clients still stops
responding after about 10 to 20 messages are sent,  so it does work for
awhile. I will check out the latest code from svn and see what happens.
On Apr 9, 2012 6:22 AM, Arno Garrels arno.garr...@gmx.de wrote:

 Arno Garrels wrote:
  Access to the protected TDictonary object is thread-safe, however
  it is not calling methods and access properties of the client objects.
  You have to communicate with the clients using Window messages.
  Look at how TWSocketThrdClient defines a new message ID and overrides
  its WndProc method.

 And even that won't be safe. If, for instance, the client has been
 detached from its thread, that is its Handle property is zero, and you call
 PostMessage(Client.Handle..) the handle will be recreated in the context
 of the calling thread, which will likely cause an error when the component
 finally destroys the Handle in main thread context.

 Bottomline: Do not use this class if you ever need to access client objects
 from outside their own event handlers. Instead TWSocketServer should be
 used,
 do lengthy, blocking tasks in a worker thread.

 --
 Arno
 --
 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

--
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


[twsocket] How to install Firemonkey beta pack for XE2

2012-04-09 Thread brian -
Are there any special steps to follow for installing the beta ICS package
(from svn) for Firemonkey? Tried to install it separately, and it gives an
error

The procedure entry point @Overbyteicslibrary@initialization$qqrv could
not be located in the dynamic link library
OverbyteIcsDXe2Run.bpl

http://i.imgur.com/PiT9o.png
--
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


Re: [twsocket] How to install Firemonkey beta pack for XE2

2012-04-09 Thread François Piette
Are there any special steps to follow for installing the beta ICS package
(from svn) for 
Firemonkey? Tried to install it separately, and it gives an error

The procedure entry point @Overbyteicslibrary@initialization$qqrv could
not be located 
in the dynamic link library OverbyteIcsDXe2Run.bpl

Are you sure you have recompiled both runtime and design time package ?
Isn't any mess in the search path so that old and new ICS are messed ?

--
francois.pie...@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