Hi all,

I have a server here with parts of it written using Indy and parts of it 
written using ICS. The two parts are distinct, listen on different ports 
and do not share any resources. Basically, I'm looking at replacing Indy 
with ICS and would like to have both technologies in one service to be 
able to connect to one or the other at will. On my development machine 
this works just fine, just the same as it works fine on our test 
environment. However, when put on a production server where most of the 
clients connect to the Indy port, I'm seeing something very annoying 
when connecting to the ICS port. Here is what happens on a working 
connection:

I connect using Telnet to the port
I type garbage
The server replies to me and closes the connection because I did not 
send the right command

However, after about ten minutes, here is what happens:

I connect using Telnet to the port
I type garbage
No reply ever comes from the server, no matter the amount of garbage I send.

I went further and traced it to the XSocketAllocateHWnd method that 
returns 0 when called from the TCustomWSocket.Create constructor for my 
client class.
Using GetLastError, I get the following message after the failure of the 
call to CreateWindowEx:

Espace insuffisant pour traiter cette commande

which in English should be the equivalent of "Not enough storage to 
complete this command"

And once this error has happened, the server stops working unless I 
restart the process.
In turn, this triggers an aexception in 
TCustomWSocket.AllocateSocketHWnd with the following call stack:

Exception raised: ESocketException, Cannot create a hidden window for 
TWSocket.
Exception address: 0239F906
---
Stack list
[0239F901] WSocket.TCustomWSocket.RaiseException (Line 1867, 
"WSocket.pas" + 4) + $E
[023A15C2] WSocket.TCustomWSocket.AllocateSocketHWnd (Line 3573, 
"WSocket.pas" + 11) + $9
[023A171B] WSocket.TCustomWSocket.Create (Line 3646, "WSocket.pas" + 3) + $5
[023A831D] WSocket.TCustomLineWSocket.Create (Line 6847, "WSocket.pas" + 
1) + $4
[0239AE8F] MyServer.TMyClientSocket.Create (Line 545, 
"uROIcsAsyncSuperTcpServer.pas" + 2) + $5
[0239D4C1] WSocketS.TCustomWSocketServer.TriggerSessionAvailable (Line 
367, "WSocketS.pas" + 22) + $A
[023A25A8] WSocket.TCustomWSocket.Do_FD_ACCEPT (Line 4342, "WSocket.pas" 
+ 2) + $8
[023A29F9] WSocket.TCustomWSocket.WMASyncSelect (Line 4460, 
"WSocket.pas" + 88) + $6
[023A0CE5] WSocket.TCustomWSocket.WndProc (Line 3291, "WSocket.pas" + 7) 
+ $5
[023A8452] WSocket.TCustomLineWSocket.WndProc (Line 6882, "WSocket.pas" 
+ 14) + $5
[0239D2C1] WSocketS.TCustomWSocketServer.WndProc (Line 314, 
"WSocketS.pas" + 14) + $5
[0239A810] MyServer.TMyWSocketServer.WndProc (Line 400, 
"uROIcsAsyncSuperTcpServer.pas" + 6) + $4
[023A1137] WSocket.XSocketWindowProc (Line 3362, "WSocket.pas" + 14) + $7
[0239C1CF] MyServer.TMessagePumpThread.Execute (Line 1006, 
"uROIcsAsyncSuperTcpServer.pas" + 12) + $4
[00430A96] Classes.ThreadProc (Line 9866, "classes.pas" + 7) + $5
[00405450] System.ThreadWrapper (Line 12127, "system.pas" + 33) + $0


As you can see, I'm using my own message pump because all this is 
implemented in a service that has no GUI whatsoever.
I don't think this can be the problem and in the end, I can't figure out 
why creating a window would return this type of error. I mean, I can 
start other processes just fine. To me, this looks like the side effect 
of some other problem, but I can't figure out which.

Any help is most welcome
Cheers
Olivier
-- 
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

Reply via email to