Hello Wilfried,

> What is exacly the exception message ?

The exception that was raised was "Socket operation on non-socket (#10038 in 
Disconnect (closesocket))."
and it was raised on this:

|00507C4D|Servidor.exe|OverByteICSWSocket.pas        |TCustomWSocket 
|RaiseException                    |2009[4]  |
|0050D08B|Servidor.exe|OverByteICSWSocket.pas        |TCustomWSocket 
|SocketError                       |7045[17] |
|0050CFD8|Servidor.exe|OverByteICSWSocket.pas        |TCustomWSocket 
|SocketError                       |7028[0]  |
|0050CBD1|Servidor.exe|OverByteICSWSocket.pas        |TCustomWSocket 
|InternalClose                     |6672[34] |
|0050CACF|Servidor.exe|OverByteICSWSocket.pas        |TCustomWSocket 
|Close                             |6589[1]  |
|0050939A|Servidor.exe|OverByteICSWSocket.pas        |TCustomWSocket 
|Destroy                           |4303[8]  |
|00509348|Servidor.exe|OverByteICSWSocket.pas        |TCustomWSocket 
|Destroy                           |4295[0]  |
|0050F4E3|Servidor.exe|OverByteICSWSocket.pas        |TCustomLineWSocket 
|Destroy                           |8104[11] |

This is the call stack that was created by EurekaLog.

The exception was raised when I was trying to free the TWSocket component, 
see the call stack, first the Destroy of TCustomLineeWSocket is called, and 
see when TCustomWSocket calls the Close routine, it calls the InternalClose 
that raises the exception.

> You have to call Close (or CloseDelayed), and in OnSessionClosed you
> post a message to custom message handler where you connect again.

I will try to do that way, sending a custom message to make a reconnection

> Is it 'no buffer space available' ? Because Windows keep the socket for
> a while after closing the connection (I think 2 minute). Sockets are
> made into the non paged memory pool which stop growing at 1/8 the size
> of physical RAM. So with the amount of sockets in TIME_WAIT state + the
> sockets you create it could be that you run out of memory ? Consider
> that a socket takes around 2 KB, and that overlapped IO (used by
> winsock) eat also in blocks of 4 KB.

Actually I don´t remember very well why it raised this EOutOfMemory 
exception, I will try to reproduce it once again and see where is raises

> Definitively not. But possible you have a memory problem because of the
> TIME_WAIT sockets (nothing to do with ICS, but that's how winsock
> works).

I´m a little affraid of this TIME_WAIT sockets :) As I said on my last 
e-mail, one day I have made one test and I left my software trying to get 
video from 20 different inacessible hosts, I left it by night, and when I 
came to see on the morning the whole windows tcp/ip was inoperant,  Firefox, 
Internet Explorer was not working and neither the windows network, I 
coulnd´t even ping any machine on my network.
Do you know why this could have happened? Considering that mny software was 
doing that reconnect procedure for all hosts.

> Use OnSessionClosed. But do not reconnect from within the event handler,
> but post a custom message so that the reconnect is outside the event.

Thanks I will try to implement on that way, Arno also gave me the same 
advice

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be 

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Reply via email to