Éric,

Since ICS works asynchronous a reconnect-timer should be started from
event handler OnSessionClosed, is that the case? 
Also the best place to destroy the object is from OnSessionClosed as
well.

--
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html 


Éric Fleming Bonilha wrote:
> Hello all,
> 
> I want to discuss an architectural issue here
> I´m debugging an application of mine and yesterday it has stopped
> working and I got the following EurekaLog call stak information 
> 
>> 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] | 7C91503E|ntdll.dll   |                              |   
>> |bsearch                           |         | 7E36A03E|USER32.dll 
>> |                              |                            
>> |ClientThreadSetup                 |         | 7C90EAF5|ntdll.dll  
>> |                              |                            
>> |KiUserApcDispatcher               |         | 7E369239|USER32.dll 
>> |                              |                            
>> |CharUpperBuffW                    |         | 7E36AEBF|USER32.dll 
>> |                              |                            
>> |CharUpperBuffA                    |         | 7E36AEE3|USER32.dll 
>> |                              |                            
>> |CharUpperBuffA                    |         | 7C90E21D|ntdll.dll  
>> |                              |                            
>> |ZwQueryVirtualMemory              |         |
>> 7C80B9B7|kernel32.dll|                              |               
>> |VirtualQueryEx                    |         |
>> 7C80B9A0|kernel32.dll|                              |               
>> |VirtualQueryEx                    |         |
>> 7C80B9E1|kernel32.dll|                              |               
>> |VirtualQuery                      |         |
>> 7C80B9D1|kernel32.dll|                              |               
>> |VirtualQuery                      |         |
>> 00509286|Servidor.exe|OverByteICSWSocket.pas        |TCustomWSocket 
>> |Create                            |427
1[6]  |
>> 00509230|Servidor.exe|OverByteICSWSocket.pas        |TCustomWSocket 
>> |Create                            |4265[0]  |
>> 0050DEC6|Servidor.exe|OverByteICSWSocket.pas       
>> |TCustomSocksWSocket          |Create                           
>> |7254[1]  | 0050DEB0|Servidor.exe|OverByteICSWSocket.pas       
>> |TCustomSocksWSocket          |Create                           
>> |7253[0]  | 0050F45E|Servidor.exe|OverByteICSWSocket.pas       
>> |TCustomLineWSocket           |Create                           
>> |8084[1]  | 0050F448|Servidor.exe|OverByteICSWSocket.pas       
>> |TCustomLineWSocket           |Create                           
>> |8083[0]  | 00534F14|Servidor.exe|UTDriverCommSocketThread.pas 
>> |TDriverCommSocketThread      |Execute                          
>> |355[11]  | 7C90E57A|ntdll.dll   |                              |   
>> |NtSetEvent                        |         |
>> 7C80A021|kernel32.dll|                              |               
>> |SetEvent                          |         |
>> 7C80A017|kernel32.dll|                              |               
>> |SetEvent                          |         |                      
> 
> 
> I have seen on OverByteICSWSocket.pas InternalClose on line 6672 it
> raises that exception only when ICS is used on DLL, but that is not
> my case  
> 
> Actually I thing that this exception was raised because of the
> architecture of my software and I need an opinion about that. 
> My software is a service application that can have several TWSocket
> clients to get live video data from different sources. Each instance
> of TWSocket is working on a different thread.  
> Apparently my application doesn´t work very well when some hosts are
> down, it frequently shuts the service down, but this happens only
> when I have some hosts down. My app has a Timeout parameter (Default
> 4 seconds) when if it doesn´t receives video from the host it closes
> the connection and opens it again, I think that I´m having some
> problems on this timeout concept, so, for example if I have 5 down
> hosts, at each 4 seconds my app will try to connect to this host, and
> I don´t know why, it is compromising my app stability       
> I have tried to do this reconnect to the host by 2 ways, by Closing
> and Opening the TWSocket connection again and by Destroying and
> Creating a new TWSocket component each time it needs to reconnect to
> the host (at each 4 seconds), on the first way (Closing and Opening)
> I got some EOutOfMemory error on ICS and on this second way
> (Destroying and Creating the TWSocket component) I got that exception
> message at the beggining of the email.      
> Can you tell me if this reconnection procedure that I made (each 4
> seconds for down hosts) is dangerous to TCP at any way? I have also
> made another test one day and I left my app trying to communicate to
> 20 differents DOWN hosts, and after some hours of operation my whole
> computer TCP communication was inoperable (neither Firefox or
> Internet Explorer was working)     
> Another thing that I have thinked is that if I need to wait the
> TWSocket connection error message before trying to reconnect to the
> host or I can close if before receiving the error message?  
> 
> Thanks!
> 
> Éric
-- 
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