Re: [twsocket] TWsocket server client list Error

2006-10-18 Thread Francois Piette
I did this in TcpSrv (adding the thread etc ) demo and into a service. The
demo works fine and no blank ip port connections appeared but the service
did not work and in some moment did not receive more connections. I still
have 10038 errors in BgExcep. I already check buffers and all code to avoid
lose of the handle.

Did you start from the demo service provided with ICS or a brand new one you
created ?
You can email me your /source/ code (no exe please. Just full source to
rebuild quickly and easily your test). I don't promize to have time to look
at it. Il will do if I find some spare time and your code is small and easy
to read.

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
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


Re: [twsocket] TWsocket server client list Error

2006-10-17 Thread Miguel Ca

Hi

I still have the same problem and i dont know why. My last test was:

1.SocketServer

2.Onclientconnect Show connection

3.OdataAvalilable : read the info send by other program, create a thread 
when the information is recieved and create a new thread with a sleep(500) 
instruction and the postmessage to make a send call from the main thread


4.OnClientDisconnect Show the list with all the clients.

I did this in TcpSrv (adding the thread etc ) demo and into a service. The 
demo works fine and no blank ip port connections appeared but the service 
did not work and in some moment did not receive more connections. I still 
have 10038 errors in BgExcep. I already check buffers and all code to avoid 
lose of the handle.


I have the demo programs, maybe i can upload or send if somebody want to 
test.



If is possible i want to talk by phone with somebody into the ICS team, or 
by msn or other media and of course we can agreed a fee for the advices. I 
am in a difficult position because my dead line was this weekend. My mail is 
[EMAIL PROTECTED] ( timezone Colombia )


Thank you for the help


Miguel Angel Cañas C.



From: Arno Garrels [EMAIL PROTECTED]
Reply-To: ICS support mailing twsocket@elists.org
To: ICS support mailing twsocket@elists.org
Subject: Re: [twsocket] TWsocket server client list Error
Date: Fri, 13 Oct 2006 17:43:00 +0200

Miguel Cañas wrote:
 hi Arno

 I am running ICS in a nt service and i am using multi threading but
 the socketservers is in the main thread.

If you use V6 there may be collisions with window messages in the beginning
of range WM_USER posted to the same _thread where TWSocketServer created 
it's

hidden window, are you using V6? Do you use PostThreadMessage?

Do you create the TWSocketServer instance in OnCreate of
TService? Only if you create it in TService.OnStart it'd run in the
service thread.

 The threads only do some
 work with a database and validation of the information received from
 the machines and in the end the threads make a send call.

Do you access the TWSocketClients from the worker threads directly, or
do you post a messsage with the worker thread result to the thread where
the TWSocketServer and its clients are running in?

If it's not the message-collision-problem of V6, it may have
to do with improper use of ICS in a multi-threaded env.,
beside the possible reasons Wilfried and Francois already mentioned.

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




 Miguel Angel Cañas C.




 From: Arno Garrels [EMAIL PROTECTED]
 Reply-To: ICS support mailing twsocket@elists.org
 To: ICS support mailing twsocket@elists.org
 Subject: Re: [twsocket] TWsocket server client list Error
 Date: Thu, 12 Oct 2006 19:03:52 +0200

 Miguel, are you running ICS in a multi-threaded application
 or in a NT-Service?

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


 Wilfried Mestdagh wrote:
 Hello Miguel,

 No not configuration. the socket handle is probably somewhere
 overwritten. Please check carefull all variable usage, and
 specially arrays that may got overrun.

 My TWsocketServer object :

 LocalAddr = '0.0.0.0'//set in runtime
 LocalPort = '0' //set in runtime

 Try to not set it, you never know. However I dont think it can
 cause the
 behavour you have.

 OnDataSent = WSocketServerExDataSent
 OnSessionClosed = WSocketServerExSessionClosed

 Set this in comment as it will never fire on server socket.

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

 Thursday, October 12, 2006, 06:58, Miguel Cañas wrote:

 Hi Wilfried

 Sorry but I didn-t have time to do a test program, I am in a dead
 line and I have another errors to fix too but this one is critical
 to me because the service is starting to loose connections.

 Let me explain better:

 1. The connections Startt to grow because of the processing time,
 the service is processing as fast as possible.
 2. I have like 50 to 60 connections in the client list
 (Wsocketserver.clientcount)
 3. I have the first Error 10038 in function Disconnect
 (closesocket) Socket operation on non-socket
 4. I?m using TcpView
 (http://www.sysinternals.com/Utilities/TcpView.html)
 and I saw that the new connection got into the list of the program
 but next disappeared and my program didn?t run the onConnect
 event, at least no t the part that is into my program.
 5. After that I saw the connection with no IP no port info and the
 Hsokcet value = -1.

 Could it  be a configuration problem ? in the TWsocket server ? or
 in the server PC?

 My TWsocketServer object :

 LineMode = False
 LineLimit = 65536
 LineEnd = #13#10
 LineEcho = False
 LineEdit = False
 Proto = 'tcp'
 LocalAddr = '0.0.0.0'//set in runtime
 LocalPort = '0' //set in runtime
 LastError = 0
 MultiThreaded = False
 MultiCast = False
 MultiCastIpTTL = 1
 ReuseAddr = False

Re: [twsocket] TWsocket server client list Error

2006-10-15 Thread Miguel Ca

Hi Arno


Miguel Cañas wrote:
 hi Arno

 I am running ICS in a nt service and i am using multi threading but
 the socketservers is in the main thread.

If you use V6 there may be collisions with window messages in the beginning
of range WM_USER posted to the same _thread where TWSocketServer created 
it's

hidden window, are you using V6? Do you use PostThreadMessage?


Im using ver 5 and I am not using PostThreadMessage.



Do you create the TWSocketServer instance in OnCreate of
TService? Only if you create it in TService.OnStart it'd run in the
service thread.


I put the component in the datamodule ( servive ) in design time, so i am 
going cerate it in OnStar.




 The threads only do some
 work with a database and validation of the information received from
 the machines and in the end the threads make a send call.

Do you access the TWSocketClients from the worker threads directly, or
do you post a messsage with the worker thread result to the thread where
the TWSocketServer and its clients are running in?

If it's not the message-collision-problem of V6, it may have
to do with improper use of ICS in a multi-threaded env.,
beside the possible reasons Wilfried and Francois already mentioned.

In this point i have a .send call in the threads tha make the process work. 
Im going to change this.


I already have a demo service, where can i put the demo in case this changes 
does not work?


Thank you



 Miguel Angel Cañas C.




 From: Arno Garrels [EMAIL PROTECTED]
 Reply-To: ICS support mailing twsocket@elists.org
 To: ICS support mailing twsocket@elists.org
 Subject: Re: [twsocket] TWsocket server client list Error
 Date: Thu, 12 Oct 2006 19:03:52 +0200

 Miguel, are you running ICS in a multi-threaded application
 or in a NT-Service?

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


 Wilfried Mestdagh wrote:
 Hello Miguel,

 No not configuration. the socket handle is probably somewhere
 overwritten. Please check carefull all variable usage, and
 specially arrays that may got overrun.

 My TWsocketServer object :

 LocalAddr = '0.0.0.0'//set in runtime
 LocalPort = '0' //set in runtime

 Try to not set it, you never know. However I dont think it can
 cause the
 behavour you have.

 OnDataSent = WSocketServerExDataSent
 OnSessionClosed = WSocketServerExSessionClosed

 Set this in comment as it will never fire on server socket.

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

 Thursday, October 12, 2006, 06:58, Miguel Cañas wrote:

 Hi Wilfried

 Sorry but I didn-t have time to do a test program, I am in a dead
 line and I have another errors to fix too but this one is critical
 to me because the service is starting to loose connections.

 Let me explain better:

 1. The connections Startt to grow because of the processing time,
 the service is processing as fast as possible.
 2. I have like 50 to 60 connections in the client list
 (Wsocketserver.clientcount)
 3. I have the first Error 10038 in function Disconnect
 (closesocket) Socket operation on non-socket
 4. I?m using TcpView
 (http://www.sysinternals.com/Utilities/TcpView.html)
 and I saw that the new connection got into the list of the program
 but next disappeared and my program didn?t run the onConnect
 event, at least no t the part that is into my program.
 5. After that I saw the connection with no IP no port info and the
 Hsokcet value = -1.

 Could it  be a configuration problem ? in the TWsocket server ? or
 in the server PC?

 My TWsocketServer object :

 LineMode = False
 LineLimit = 65536
 LineEnd = #13#10
 LineEcho = False
 LineEdit = False
 Proto = 'tcp'
 LocalAddr = '0.0.0.0'//set in runtime
 LocalPort = '0' //set in runtime
 LastError = 0
 MultiThreaded = False
 MultiCast = False
 MultiCastIpTTL = 1
 ReuseAddr = False
 ComponentOptions = []
 ListenBacklog = 1000 //s
 ReqVerLow = 1
 ReqVerHigh = 1
 OnDataSent = WSocketServerExDataSent
 OnSessionClosed = WSocketServerExSessionClosed
 OnBgException = WSocketServerExBgException
 FlushTimeout = 60
 SendFlags = wsSendNormal
 LingerOnOff = wsLingerOn
 LingerTimeout = 0
 KeepAliveOnOff = wsKeepAliveOnSystem
 KeepAliveTime = 3
 KeepAliveInterval = 1000
 SocksLevel = '5'
 SocksAuthentication = socksNoAuthentication
 BannerTooBusy = 'Sorry, too many clients'
 MaxClients = 300
 OnClientDisconnect = WSocketServerExClientDisconnect
 OnClientConnect = WSocketServerExClientConnect


 Miguel Angel Cañas C.




 From: Wilfried Mestdagh [EMAIL PROTECTED]
 Reply-To: ICS support mailing twsocket@elists.org
 To: ICS support mailing twsocket@elists.org
 Subject: Re: [twsocket] TWsocket server client list Error
 Date: Fri, 6 Oct 2006 12:35:51 +0200

 Hello Miguel,

 Your code looks OK. Very strange this behavour. Can you make a
 simple demo (GUI) project

Re: [twsocket] TWsocket server client list Error

2006-10-13 Thread Miguel Ca

hi Arno

I am running ICS in a nt service and i am using multi threading but the 
socketservers is in the main thread. The threads only do some work with a 
database and validation of the information received from the machines and in 
the end the threads make a send call.




Miguel Angel Cañas C.





From: Arno Garrels [EMAIL PROTECTED]
Reply-To: ICS support mailing twsocket@elists.org
To: ICS support mailing twsocket@elists.org
Subject: Re: [twsocket] TWsocket server client list Error
Date: Thu, 12 Oct 2006 19:03:52 +0200

Miguel, are you running ICS in a multi-threaded application
or in a NT-Service?

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


Wilfried Mestdagh wrote:
 Hello Miguel,

 No not configuration. the socket handle is probably somewhere
 overwritten. Please check carefull all variable usage, and specially
 arrays that may got overrun.

 My TWsocketServer object :

 LocalAddr = '0.0.0.0'//set in runtime
 LocalPort = '0' //set in runtime

 Try to not set it, you never know. However I dont think it can cause
 the
 behavour you have.

 OnDataSent = WSocketServerExDataSent
 OnSessionClosed = WSocketServerExSessionClosed

 Set this in comment as it will never fire on server socket.

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

 Thursday, October 12, 2006, 06:58, Miguel Cañas wrote:

 Hi Wilfried

 Sorry but I didn-t have time to do a test program, I am in a dead
 line and I have another errors to fix too but this one is critical
 to me because the service is starting to loose connections.

 Let me explain better:

 1. The connections Startt to grow because of the processing time, the
 service is processing as fast as possible.
 2. I have like 50 to 60 connections in the client list
 (Wsocketserver.clientcount)
 3. I have the first Error 10038 in function Disconnect (closesocket)
 Socket operation on non-socket
 4. I?m using TcpView
 (http://www.sysinternals.com/Utilities/TcpView.html)
 and I saw that the new connection got into the list of the program
 but next disappeared and my program didn?t run the onConnect event,
 at least no t the part that is into my program.
 5. After that I saw the connection with no IP no port info and the
 Hsokcet value = -1.

 Could it  be a configuration problem ? in the TWsocket server ? or
 in the server PC?

 My TWsocketServer object :

 LineMode = False
 LineLimit = 65536
 LineEnd = #13#10
 LineEcho = False
 LineEdit = False
 Proto = 'tcp'
 LocalAddr = '0.0.0.0'//set in runtime
 LocalPort = '0' //set in runtime
 LastError = 0
 MultiThreaded = False
 MultiCast = False
 MultiCastIpTTL = 1
 ReuseAddr = False
 ComponentOptions = []
 ListenBacklog = 1000 //s
 ReqVerLow = 1
 ReqVerHigh = 1
 OnDataSent = WSocketServerExDataSent
 OnSessionClosed = WSocketServerExSessionClosed
 OnBgException = WSocketServerExBgException
 FlushTimeout = 60
 SendFlags = wsSendNormal
 LingerOnOff = wsLingerOn
 LingerTimeout = 0
 KeepAliveOnOff = wsKeepAliveOnSystem
 KeepAliveTime = 3
 KeepAliveInterval = 1000
 SocksLevel = '5'
 SocksAuthentication = socksNoAuthentication
 BannerTooBusy = 'Sorry, too many clients'
 MaxClients = 300
 OnClientDisconnect = WSocketServerExClientDisconnect
 OnClientConnect = WSocketServerExClientConnect


 Miguel Angel Cañas C.




 From: Wilfried Mestdagh [EMAIL PROTECTED]
 Reply-To: ICS support mailing twsocket@elists.org
 To: ICS support mailing twsocket@elists.org
 Subject: Re: [twsocket] TWsocket server client list Error
 Date: Fri, 6 Oct 2006 12:35:51 +0200

 Hello Miguel,

 Your code looks OK. Very strange this behavour. Can you make a
 simple demo (GUI) project to demonstrate the behavour ?  Possible I
 have time this weekend to investigate it.

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

 Friday, October 6, 2006, 03:25, Miguel Cañas wrote:

 Hello Wilfried

 Today i made some test and the results are not good for me. I
 colud no t find the error that triggger the exceptior but i find
 that for each exception i have an 'empty' connection (no ip no
 port).

 I will make a little explanacion of my code. My service is a tcp
 server very similar to the example that comes with ICS componets.

 My code look like this

 WSocketServerExClientConnect()
   
 OnDataAvailable := ClientDataAvailable;
 OnBgException := ClientBgException;
 ConnectTime := Time
 

 writeinTxtFile( '--Conexiones Activas : ' + IntToStr(
 WSocketServerEx.ClientCount ), true );
 for i := 0 to WSocketServerEx.ClientCount - 1 do
 begin
   writeinTxtFile( Format( '--Activa[%d] IP [%s] PORT [%s]',
 [ i, WSocketServerEx.client[ i ].getPeerAddr,
 WSocketServerEx.client[ i ].getPeerport

Re: [twsocket] TWsocket server client list Error

2006-10-13 Thread Arno Garrels
Miguel Cañas wrote:
 hi Arno
 
 I am running ICS in a nt service and i am using multi threading but
 the socketservers is in the main thread. 

If you use V6 there may be collisions with window messages in the beginning 
of range WM_USER posted to the same _thread where TWSocketServer created it's
hidden window, are you using V6? Do you use PostThreadMessage? 
 
Do you create the TWSocketServer instance in OnCreate of
TService? Only if you create it in TService.OnStart it'd run in the
service thread. 

 The threads only do some
 work with a database and validation of the information received from
 the machines and in the end the threads make a send call.

Do you access the TWSocketClients from the worker threads directly, or
do you post a messsage with the worker thread result to the thread where
the TWSocketServer and its clients are running in? 

If it's not the message-collision-problem of V6, it may have 
to do with improper use of ICS in a multi-threaded env.,
beside the possible reasons Wilfried and Francois already mentioned.

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

 
 
 
 Miguel Angel Cañas C.
 
 
 
 
 From: Arno Garrels [EMAIL PROTECTED]
 Reply-To: ICS support mailing twsocket@elists.org
 To: ICS support mailing twsocket@elists.org
 Subject: Re: [twsocket] TWsocket server client list Error
 Date: Thu, 12 Oct 2006 19:03:52 +0200
 
 Miguel, are you running ICS in a multi-threaded application
 or in a NT-Service?
 
 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 
 
 Wilfried Mestdagh wrote:
 Hello Miguel,
 
 No not configuration. the socket handle is probably somewhere
 overwritten. Please check carefull all variable usage, and
 specially arrays that may got overrun.
 
 My TWsocketServer object :
 
 LocalAddr = '0.0.0.0'//set in runtime
 LocalPort = '0' //set in runtime
 
 Try to not set it, you never know. However I dont think it can
 cause the
 behavour you have.
 
 OnDataSent = WSocketServerExDataSent
 OnSessionClosed = WSocketServerExSessionClosed
 
 Set this in comment as it will never fire on server socket.
 
 ---
 Rgds, Wilfried [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 http://www.mestdagh.biz
 
 Thursday, October 12, 2006, 06:58, Miguel Cañas wrote:
 
 Hi Wilfried
 
 Sorry but I didn-t have time to do a test program, I am in a dead
 line and I have another errors to fix too but this one is critical
 to me because the service is starting to loose connections.
 
 Let me explain better:
 
 1. The connections Startt to grow because of the processing time,
 the service is processing as fast as possible.
 2. I have like 50 to 60 connections in the client list
 (Wsocketserver.clientcount)
 3. I have the first Error 10038 in function Disconnect
 (closesocket) Socket operation on non-socket
 4. I?m using TcpView
 (http://www.sysinternals.com/Utilities/TcpView.html)
 and I saw that the new connection got into the list of the program
 but next disappeared and my program didn?t run the onConnect
 event, at least no t the part that is into my program.
 5. After that I saw the connection with no IP no port info and the
 Hsokcet value = -1.
 
 Could it  be a configuration problem ? in the TWsocket server ? or
 in the server PC?
 
 My TWsocketServer object :
 
 LineMode = False
 LineLimit = 65536
 LineEnd = #13#10
 LineEcho = False
 LineEdit = False
 Proto = 'tcp'
 LocalAddr = '0.0.0.0'//set in runtime
 LocalPort = '0' //set in runtime
 LastError = 0
 MultiThreaded = False
 MultiCast = False
 MultiCastIpTTL = 1
 ReuseAddr = False
 ComponentOptions = []
 ListenBacklog = 1000 //s
 ReqVerLow = 1
 ReqVerHigh = 1
 OnDataSent = WSocketServerExDataSent
 OnSessionClosed = WSocketServerExSessionClosed
 OnBgException = WSocketServerExBgException
 FlushTimeout = 60
 SendFlags = wsSendNormal
 LingerOnOff = wsLingerOn
 LingerTimeout = 0
 KeepAliveOnOff = wsKeepAliveOnSystem
 KeepAliveTime = 3
 KeepAliveInterval = 1000
 SocksLevel = '5'
 SocksAuthentication = socksNoAuthentication
 BannerTooBusy = 'Sorry, too many clients'
 MaxClients = 300
 OnClientDisconnect = WSocketServerExClientDisconnect
 OnClientConnect = WSocketServerExClientConnect
 
 
 Miguel Angel Cañas C.
 
 
 
 
 From: Wilfried Mestdagh [EMAIL PROTECTED]
 Reply-To: ICS support mailing twsocket@elists.org
 To: ICS support mailing twsocket@elists.org
 Subject: Re: [twsocket] TWsocket server client list Error
 Date: Fri, 6 Oct 2006 12:35:51 +0200
 
 Hello Miguel,
 
 Your code looks OK. Very strange this behavour. Can you make a
 simple demo (GUI) project to demonstrate the behavour ? 
 Possible I have time this weekend to investigate it.
 
 ---
 Rgds, Wilfried [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 http://www.mestdagh.biz
 
 Friday, October 6, 2006, 03:25, Miguel Cañas wrote:
 
 Hello Wilfried

Re: [twsocket] TWsocket server client list Error

2006-10-12 Thread Wilfried Mestdagh
Hello Miguel,

No not configuration. the socket handle is probably somewhere
overwritten. Please check carefull all variable usage, and specially
arrays that may got overrun.

 My TWsocketServer object :

 LocalAddr = '0.0.0.0'//set in runtime
 LocalPort = '0' //set in runtime

Try to not set it, you never know. However I dont think it can cause the
behavour you have.

 OnDataSent = WSocketServerExDataSent
 OnSessionClosed = WSocketServerExSessionClosed

Set this in comment as it will never fire on server socket.

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

Thursday, October 12, 2006, 06:58, Miguel Cañas wrote:

 Hi Wilfried

 Sorry but I didn-t have time to do a test program, I am in a dead line and I
 have another errors to fix too but this one is critical to me because the
 service is starting to loose connections.

 Let me explain better:

 1.The connections Startt to grow because of the processing time, the 
 service is processing as fast as possible.
 2.I have like 50 to 60 connections in the client list 
 (Wsocketserver.clientcount)
 3.I have the first Error 10038 in function Disconnect (closesocket) Socket
 operation on non-socket
 4.I’m using TcpView
 (http://www.sysinternals.com/Utilities/TcpView.html) 
 and I saw that the new connection got into the list of the program but next
 disappeared and my program didn’t run the onConnect event, at least no t the
 part that is into my program.
 5.After that I saw the connection with no IP no port info and the Hsokcet
 value = -1.

 Could it  be a configuration problem ? in the TWsocket server ? or in the
 server PC?

 My TWsocketServer object :

 LineMode = False
 LineLimit = 65536
 LineEnd = #13#10
 LineEcho = False
 LineEdit = False
 Proto = 'tcp'
 LocalAddr = '0.0.0.0'//set in runtime
 LocalPort = '0' //set in runtime
 LastError = 0
 MultiThreaded = False
 MultiCast = False
 MultiCastIpTTL = 1
 ReuseAddr = False
 ComponentOptions = []
 ListenBacklog = 1000 //s
 ReqVerLow = 1
 ReqVerHigh = 1
 OnDataSent = WSocketServerExDataSent
 OnSessionClosed = WSocketServerExSessionClosed
 OnBgException = WSocketServerExBgException
 FlushTimeout = 60
 SendFlags = wsSendNormal
 LingerOnOff = wsLingerOn
 LingerTimeout = 0
 KeepAliveOnOff = wsKeepAliveOnSystem
 KeepAliveTime = 3
 KeepAliveInterval = 1000
 SocksLevel = '5'
 SocksAuthentication = socksNoAuthentication
 BannerTooBusy = 'Sorry, too many clients'
 MaxClients = 300
 OnClientDisconnect = WSocketServerExClientDisconnect
 OnClientConnect = WSocketServerExClientConnect


 Miguel Angel Cañas C.




From: Wilfried Mestdagh [EMAIL PROTECTED]
Reply-To: ICS support mailing twsocket@elists.org
To: ICS support mailing twsocket@elists.org
Subject: Re: [twsocket] TWsocket server client list Error
Date: Fri, 6 Oct 2006 12:35:51 +0200

Hello Miguel,

Your code looks OK. Very strange this behavour. Can you make a simple
demo (GUI) project to demonstrate the behavour ?  Possible I have time
this weekend to investigate it.

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

Friday, October 6, 2006, 03:25, Miguel Cañas wrote:

  Hello Wilfried

  Today i made some test and the results are not good for me. I colud no t
  find the error that triggger the exceptior but i find that for each
  exception i have an 'empty' connection (no ip no port).

  I will make a little explanacion of my code. My service is a tcp server
very
  similar to the example that comes with ICS componets.

  My code look like this

  WSocketServerExClientConnect()

  OnDataAvailable := ClientDataAvailable;
  OnBgException := ClientBgException;
  ConnectTime := Time
  

  writeinTxtFile( '--Conexiones Activas : ' + IntToStr(
  WSocketServerEx.ClientCount ), true );
  for i := 0 to WSocketServerEx.ClientCount - 1 do
  begin
writeinTxtFile( Format( '--Activa[%d] IP [%s] PORT [%s]',
  [ i, WSocketServerEx.client[ i ].getPeerAddr,
  WSocketServerEx.client[ i ].getPeerport ]
  ) );
  end;
  ...
  end

  WSocketServerExClientDisconnect( )
  ...
  for i := 0 to WSocketServerEx.ClientCount - 1 do
  begin
WriteTxtFile( Format( '--D Activa[%d] IP [%s] PORT [%s]',
  [ i, WSocketServerEx.client[ i ].getPeerAddr,
  WSocketServerEx.client[ i ].getPeerport ]
   ) );
 end;
  ..
  end;


  When i have like 150 or 200 connections in the list i have something
like
  this in my txt file

  [05/10/2006 11:21:15:845] --D Activa[165] IP [] PORT []

  and if i try to do .close call this call works but nothing happen, not
to
  the list no exception, no disconnect event nothing.

  This behavior repeats only with heavy traffic

Re: [twsocket] TWsocket server client list Error

2006-10-12 Thread Arno Garrels
Miguel, are you running ICS in a multi-threaded application
or in a NT-Service?

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


Wilfried Mestdagh wrote:
 Hello Miguel,
 
 No not configuration. the socket handle is probably somewhere
 overwritten. Please check carefull all variable usage, and specially
 arrays that may got overrun.
 
 My TWsocketServer object :
 
 LocalAddr = '0.0.0.0'//set in runtime
 LocalPort = '0' //set in runtime
 
 Try to not set it, you never know. However I dont think it can cause
 the 
 behavour you have.
 
 OnDataSent = WSocketServerExDataSent
 OnSessionClosed = WSocketServerExSessionClosed
 
 Set this in comment as it will never fire on server socket.
 
 ---
 Rgds, Wilfried [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 http://www.mestdagh.biz
 
 Thursday, October 12, 2006, 06:58, Miguel Cañas wrote:
 
 Hi Wilfried
 
 Sorry but I didn-t have time to do a test program, I am in a dead
 line and I have another errors to fix too but this one is critical
 to me because the service is starting to loose connections.
 
 Let me explain better:
 
 1. The connections Startt to grow because of the processing time, the
 service is processing as fast as possible.
 2. I have like 50 to 60 connections in the client list
 (Wsocketserver.clientcount)
 3. I have the first Error 10038 in function Disconnect (closesocket)
 Socket operation on non-socket
 4. I?m using TcpView
 (http://www.sysinternals.com/Utilities/TcpView.html)
 and I saw that the new connection got into the list of the program
 but next disappeared and my program didn?t run the onConnect event,
 at least no t the part that is into my program.
 5. After that I saw the connection with no IP no port info and the
 Hsokcet value = -1.
 
 Could it  be a configuration problem ? in the TWsocket server ? or
 in the server PC?
 
 My TWsocketServer object :
 
 LineMode = False
 LineLimit = 65536
 LineEnd = #13#10
 LineEcho = False
 LineEdit = False
 Proto = 'tcp'
 LocalAddr = '0.0.0.0'//set in runtime
 LocalPort = '0' //set in runtime
 LastError = 0
 MultiThreaded = False
 MultiCast = False
 MultiCastIpTTL = 1
 ReuseAddr = False
 ComponentOptions = []
 ListenBacklog = 1000 //s
 ReqVerLow = 1
 ReqVerHigh = 1
 OnDataSent = WSocketServerExDataSent
 OnSessionClosed = WSocketServerExSessionClosed
 OnBgException = WSocketServerExBgException
 FlushTimeout = 60
 SendFlags = wsSendNormal
 LingerOnOff = wsLingerOn
 LingerTimeout = 0
 KeepAliveOnOff = wsKeepAliveOnSystem
 KeepAliveTime = 3
 KeepAliveInterval = 1000
 SocksLevel = '5'
 SocksAuthentication = socksNoAuthentication
 BannerTooBusy = 'Sorry, too many clients'
 MaxClients = 300
 OnClientDisconnect = WSocketServerExClientDisconnect
 OnClientConnect = WSocketServerExClientConnect
 
 
 Miguel Angel Cañas C.
 
 
 
 
 From: Wilfried Mestdagh [EMAIL PROTECTED]
 Reply-To: ICS support mailing twsocket@elists.org
 To: ICS support mailing twsocket@elists.org
 Subject: Re: [twsocket] TWsocket server client list Error
 Date: Fri, 6 Oct 2006 12:35:51 +0200
 
 Hello Miguel,
 
 Your code looks OK. Very strange this behavour. Can you make a
 simple demo (GUI) project to demonstrate the behavour ?  Possible I
 have time this weekend to investigate it.
 
 ---
 Rgds, Wilfried [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 http://www.mestdagh.biz
 
 Friday, October 6, 2006, 03:25, Miguel Cañas wrote:
 
 Hello Wilfried
 
 Today i made some test and the results are not good for me. I
 colud no t find the error that triggger the exceptior but i find
 that for each exception i have an 'empty' connection (no ip no
 port). 
 
 I will make a little explanacion of my code. My service is a tcp
 server very similar to the example that comes with ICS componets.
 
 My code look like this
 
 WSocketServerExClientConnect()
   
 OnDataAvailable := ClientDataAvailable;
 OnBgException := ClientBgException;
 ConnectTime := Time
 
 
 writeinTxtFile( '--Conexiones Activas : ' + IntToStr(
 WSocketServerEx.ClientCount ), true );
 for i := 0 to WSocketServerEx.ClientCount - 1 do
 begin
   writeinTxtFile( Format( '--Activa[%d] IP [%s] PORT [%s]',
 [ i, WSocketServerEx.client[ i ].getPeerAddr,
 WSocketServerEx.client[ i ].getPeerport ]
 ) );
 end;
 ...
 end
 
 WSocketServerExClientDisconnect( )
 ...
 for i := 0 to WSocketServerEx.ClientCount - 1 do
 begin
   WriteTxtFile( Format( '--D Activa[%d] IP [%s] PORT [%s]',
 [ i, WSocketServerEx.client[ i ].getPeerAddr,
 WSocketServerEx.client[ i ].getPeerport ]
  ) );
end;
 ..
 end;
 
 
 When i have like 150 or 200 connections in the list i have
 something like this in my txt file
 
 [05/10/2006 11:21:15:845] --D Activa[165] IP

Re: [twsocket] TWsocket server client list Error

2006-10-11 Thread Miguel Ca

Hi Wilfried

Sorry but I didn-t have time to do a test program, I am in a dead line and I 
have another errors to fix too but this one is critical to me because the 
service is starting to loose connections.


Let me explain better:

1.	The connections Startt to grow because of the processing time, the 
service is processing as fast as possible.
2.	I have like 50 to 60 connections in the client list 
(Wsocketserver.clientcount)
3.	I have the first Error 10038 in function Disconnect (closesocket) Socket 
operation on non-socket
4.	I’m using TcpView (http://www.sysinternals.com/Utilities/TcpView.html) 
and I saw that the new connection got into the list of the program but next 
disappeared and my program didn’t run the onConnect event, at least no t the 
part that is into my program.
5.	After that I saw the connection with no IP no port info and the Hsokcet 
value = -1.


Could it  be a configuration problem ? in the TWsocket server ? or in the 
server PC?


My TWsocketServer object :

   LineMode = False
   LineLimit = 65536
   LineEnd = #13#10
   LineEcho = False
   LineEdit = False
   Proto = 'tcp'
   LocalAddr = '0.0.0.0'//set in runtime
   LocalPort = '0' //set in runtime
   LastError = 0
   MultiThreaded = False
   MultiCast = False
   MultiCastIpTTL = 1
   ReuseAddr = False
   ComponentOptions = []
   ListenBacklog = 1000 //s
   ReqVerLow = 1
   ReqVerHigh = 1
   OnDataSent = WSocketServerExDataSent
   OnSessionClosed = WSocketServerExSessionClosed
   OnBgException = WSocketServerExBgException
   FlushTimeout = 60
   SendFlags = wsSendNormal
   LingerOnOff = wsLingerOn
   LingerTimeout = 0
   KeepAliveOnOff = wsKeepAliveOnSystem
   KeepAliveTime = 3
   KeepAliveInterval = 1000
   SocksLevel = '5'
   SocksAuthentication = socksNoAuthentication
   BannerTooBusy = 'Sorry, too many clients'
   MaxClients = 300
   OnClientDisconnect = WSocketServerExClientDisconnect
   OnClientConnect = WSocketServerExClientConnect


Miguel Angel Cañas C.





From: Wilfried Mestdagh [EMAIL PROTECTED]
Reply-To: ICS support mailing twsocket@elists.org
To: ICS support mailing twsocket@elists.org
Subject: Re: [twsocket] TWsocket server client list Error
Date: Fri, 6 Oct 2006 12:35:51 +0200

Hello Miguel,

Your code looks OK. Very strange this behavour. Can you make a simple
demo (GUI) project to demonstrate the behavour ?  Possible I have time
this weekend to investigate it.

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

Friday, October 6, 2006, 03:25, Miguel Cañas wrote:

 Hello Wilfried

 Today i made some test and the results are not good for me. I colud no t
 find the error that triggger the exceptior but i find that for each
 exception i have an 'empty' connection (no ip no port).

 I will make a little explanacion of my code. My service is a tcp server 
very

 similar to the example that comes with ICS componets.

 My code look like this

 WSocketServerExClientConnect()
   
 OnDataAvailable := ClientDataAvailable;
 OnBgException := ClientBgException;
 ConnectTime := Time
 

 writeinTxtFile( '--Conexiones Activas : ' + IntToStr(
 WSocketServerEx.ClientCount ), true );
 for i := 0 to WSocketServerEx.ClientCount - 1 do
 begin
   writeinTxtFile( Format( '--Activa[%d] IP [%s] PORT [%s]',
 [ i, WSocketServerEx.client[ i ].getPeerAddr,
 WSocketServerEx.client[ i ].getPeerport ]
 ) );
 end;
 ...
 end

 WSocketServerExClientDisconnect( )
 ...
 for i := 0 to WSocketServerEx.ClientCount - 1 do
 begin
   WriteTxtFile( Format( '--D Activa[%d] IP [%s] PORT [%s]',
 [ i, WSocketServerEx.client[ i ].getPeerAddr,
 WSocketServerEx.client[ i ].getPeerport ]
  ) );
end;
 ..
 end;


 When i have like 150 or 200 connections in the list i have something 
like

 this in my txt file

 [05/10/2006 11:21:15:845] --D Activa[165] IP [] PORT []

 and if i try to do .close call this call works but nothing happen, not 
to

 the list no exception, no disconnect event nothing.

 This behavior repeats only with heavy traffic.

 If i start a new valid connection after i while this connection is added 
to
 the end and works fine if no heavy traffic start again but i can free 
the

 used positions with empty connections (no ip no port).

 Thank you

 Miguel Angel Cañas C.


From: Wilfried Mestdagh [EMAIL PROTECTED]
Reply-To: ICS support mailing twsocket@elists.org
To: twsocket@elists.org
Subject: Re: [twsocket] TWsocket server client list Error
Date: Thu, 5 Oct 2006 15:59:48 +0200

Hello Miguel,

  However I want to ask something to, Is there a theory for the
connections
  without IP and PORT that shows the TWsocketServer.client[i]?

No I have no theory at the momen. With empty  IP and Port, which
properties do you exacly mean ?

  in case that some timeotu expired, the code looks like this:

Code looks OK to me.

---
Rgds, Wilfried

Re: [twsocket] TWsocket server client list Error

2006-10-06 Thread Wilfried Mestdagh
Hello Miguel,

Your code looks OK. Very strange this behavour. Can you make a simple
demo (GUI) project to demonstrate the behavour ?  Possible I have time
this weekend to investigate it.

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

Friday, October 6, 2006, 03:25, Miguel Cañas wrote:

 Hello Wilfried

 Today i made some test and the results are not good for me. I colud no t
 find the error that triggger the exceptior but i find that for each 
 exception i have an 'empty' connection (no ip no port).

 I will make a little explanacion of my code. My service is a tcp server very
 similar to the example that comes with ICS componets.

 My code look like this

 WSocketServerExClientConnect()
   
 OnDataAvailable := ClientDataAvailable;
 OnBgException := ClientBgException;
 ConnectTime := Time
 

 writeinTxtFile( '--Conexiones Activas : ' + IntToStr( 
 WSocketServerEx.ClientCount ), true );
 for i := 0 to WSocketServerEx.ClientCount - 1 do
 begin
   writeinTxtFile( Format( '--Activa[%d] IP [%s] PORT [%s]',
 [ i, WSocketServerEx.client[ i ].getPeerAddr, 
 WSocketServerEx.client[ i ].getPeerport ]
 ) );
 end;
 ...
 end

 WSocketServerExClientDisconnect( )
 ...
 for i := 0 to WSocketServerEx.ClientCount - 1 do
 begin
   WriteTxtFile( Format( '--D Activa[%d] IP [%s] PORT [%s]',
 [ i, WSocketServerEx.client[ i ].getPeerAddr, 
 WSocketServerEx.client[ i ].getPeerport ]
  ) );
end;
 ..
 end;


 When i have like 150 or 200 connections in the list i have something like
 this in my txt file

 [05/10/2006 11:21:15:845] --D Activa[165] IP [] PORT []

 and if i try to do .close call this call works but nothing happen, not to
 the list no exception, no disconnect event nothing.

 This behavior repeats only with heavy traffic.

 If i start a new valid connection after i while this connection is added to
 the end and works fine if no heavy traffic start again but i can free the
 used positions with empty connections (no ip no port).

 Thank you

 Miguel Angel Cañas C.


From: Wilfried Mestdagh [EMAIL PROTECTED]
Reply-To: ICS support mailing twsocket@elists.org
To: twsocket@elists.org
Subject: Re: [twsocket] TWsocket server client list Error
Date: Thu, 5 Oct 2006 15:59:48 +0200

Hello Miguel,

  However I want to ask something to, Is there a theory for the 
connections
  without IP and PORT that shows the TWsocketServer.client[i]?

No I have no theory at the momen. With empty  IP and Port, which
properties do you exacly mean ?

  in case that some timeotu expired, the code looks like this:

Code looks OK to me.

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

Thursday, October 5, 2006, 15:37, Miguel Cañas wrote:

  Thank you for the answer Wilfried

  Im following your suggestios and I will test the Wsockets events today
with
  try .. except blocks to try to find the error.

  However I want to ask something to, Is there a theory for the 
connections
  without IP and PORT that shows the TWsocketServer.client[i]?

  [04/10/2006 17:24:09:296] --D Activa[1] IP [] PORT []

  because I have a procedure that check for connections to make a close
socket
  in case that some timeotu expired, the code looks like this:

  //check for a valid client
  if WSocketServerEx.IsClient( WSocketServerEx.Client[ i ] )
then
  begin
   //Close socket. Nothing send.
TTcpSrvClient( WSocketServerEx.Client[ i ] ).Close;
 end;
  I can see thar in the case of the no IP no port connections i can do a
  .Close call

  Thank you

  Miguel Angel Cañas C.


 From: Wilfried Mestdagh [EMAIL PROTECTED]
 Reply-To: ICS support mailing twsocket@elists.org
 To: ICS support mailing twsocket@elists.org
 Subject: Re: [twsocket] TWsocket server client list Error
 Date: Thu, 5 Oct 2006 12:42:03 +0200
 
 Hello Miguel,
 
 BGException is background exception. It comes from the message pump.
 This means it can come also from your code in one of the TWSocket
 events. To test put them all in a exception block until you found the
 error (if it is over there of course).
 
 Socket operation on a non socket means that somewhere some handle is
 overwritten. Mostly this comes because you have somewhere written
 outside a variable (so written [partly] to another).
 
 This is not nececary the same moment but has happend a little while
 before it.
 
 Also possible is that you have a pointer to a datasocket that is not
 exestant anymore. If you have an array of sockets or so, be sure to
 update it on OnClientConnect / OnClientDisconnect. Remember also that in
 OnClientDisconnect the datasocket in question is still there, it is
 called before it is destroyed (also the count argument).
 
 ---
 Rgds, Wilfried [TeamICS]
 http://www.overbyte.be/eng/overbyte

[twsocket] TWsocket server client list Error

2006-10-05 Thread Miguel Ca

Hi

I am using TwSocketServer in a service application that receives information 
from a POS Machine (using TCP) and I am having problems with the number of 
clients that shows WSocketServerEx.ClientCount. In some cases clientcount 
return more connections than the number of machines that I have connected to 
the service.  I am saving the client list in txt file and it shows this;


[04/10/2006 17:24:09:296] --D Activa[0] IP [] PORT []
[04/10/2006 17:24:09:296] --D Activa[1] IP [] PORT []
[04/10/2006 17:24:09:296] --D Activa[2] IP [] PORT []
[04/10/2006 17:24:09:296] --D Activa[3] IP [10.10.10.237] PORT [2379]

What happen with the positions 0,1 and 2 that shows no port or ip??

I have found this exception 2 segs before the addition of a new 'empty´(no 
ip or port) connection and was capture in WSocketServerExBgException.


[04/10/2006 17:24:07:453] [ESocketException] Msg[Error 10038 in function 
Disconnect (closesocket)

Socket operation on non-socket]

Is there a relationship between this exception and the addition of the new 
empty connection? or I have to look for the error in another place.

Any help would be appreciated.

Thank you

Miguel Angel Cañas C.

_
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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

Re: [twsocket] TWsocket server client list Error

2006-10-05 Thread Wilfried Mestdagh
Hello Miguel,

BGException is background exception. It comes from the message pump.
This means it can come also from your code in one of the TWSocket
events. To test put them all in a exception block until you found the
error (if it is over there of course).

Socket operation on a non socket means that somewhere some handle is
overwritten. Mostly this comes because you have somewhere written
outside a variable (so written [partly] to another).

This is not nececary the same moment but has happend a little while
before it.

Also possible is that you have a pointer to a datasocket that is not
exestant anymore. If you have an array of sockets or so, be sure to
update it on OnClientConnect / OnClientDisconnect. Remember also that in
OnClientDisconnect the datasocket in question is still there, it is
called before it is destroyed (also the count argument).

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

Thursday, October 5, 2006, 09:06, Miguel Cañas wrote:

 Hi

 I am using TwSocketServer in a service application that receives information
 from a POS Machine (using TCP) and I am having problems with the number of
 clients that shows WSocketServerEx.ClientCount. In some cases clientcount
 return more connections than the number of machines that I have connected to
 the service.  I am saving the client list in txt file and it shows this;

 [04/10/2006 17:24:09:296] --D Activa[0] IP [] PORT []
 [04/10/2006 17:24:09:296] --D Activa[1] IP [] PORT []
 [04/10/2006 17:24:09:296] --D Activa[2] IP [] PORT []
 [04/10/2006 17:24:09:296] --D Activa[3] IP [10.10.10.237] PORT [2379]

 What happen with the positions 0,1 and 2 that shows no port or ip??

 I have found this exception 2 segs before the addition of a new 'emptyŽ(no
 ip or port) connection and was capture in WSocketServerExBgException.

 [04/10/2006 17:24:07:453] [ESocketException] Msg[Error 10038 in function
 Disconnect (closesocket)
 Socket operation on non-socket]

 Is there a relationship between this exception and the addition of the new
 empty connection? or I have to look for the error in another place.
 Any help would be appreciated.

 Thank you

 Miguel Angel Cañas C.

 _
 Express yourself instantly with MSN Messenger! Download today it's FREE!
 http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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


Re: [twsocket] TWsocket server client list Error

2006-10-05 Thread Miguel Ca

Thank you for the answer Wilfried

Im following your suggestios and I will test the Wsockets events today with 
try .. except blocks to try to find the error.


However I want to ask something to, Is there a theory for the connections 
without IP and PORT that shows the TWsocketServer.client[i]?


[04/10/2006 17:24:09:296] --D Activa[1] IP [] PORT []

because I have a procedure that check for connections to make a close socket 
in case that some timeotu expired, the code looks like this:


//check for a valid client
   if WSocketServerEx.IsClient( WSocketServerEx.Client[ i ] ) then
   begin
//Close socket. Nothing send.
 TTcpSrvClient( WSocketServerEx.Client[ i ] ).Close;
  end;
I can see thar in the case of the no IP no port connections i can do a 
.Close call


Thank you

Miguel Angel Cañas C.



From: Wilfried Mestdagh [EMAIL PROTECTED]
Reply-To: ICS support mailing twsocket@elists.org
To: ICS support mailing twsocket@elists.org
Subject: Re: [twsocket] TWsocket server client list Error
Date: Thu, 5 Oct 2006 12:42:03 +0200

Hello Miguel,

BGException is background exception. It comes from the message pump.
This means it can come also from your code in one of the TWSocket
events. To test put them all in a exception block until you found the
error (if it is over there of course).

Socket operation on a non socket means that somewhere some handle is
overwritten. Mostly this comes because you have somewhere written
outside a variable (so written [partly] to another).

This is not nececary the same moment but has happend a little while
before it.

Also possible is that you have a pointer to a datasocket that is not
exestant anymore. If you have an array of sockets or so, be sure to
update it on OnClientConnect / OnClientDisconnect. Remember also that in
OnClientDisconnect the datasocket in question is still there, it is
called before it is destroyed (also the count argument).

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

Thursday, October 5, 2006, 09:06, Miguel Cañas wrote:

 Hi

 I am using TwSocketServer in a service application that receives 
information
 from a POS Machine (using TCP) and I am having problems with the number 
of
 clients that shows WSocketServerEx.ClientCount. In some cases 
clientcount
 return more connections than the number of machines that I have 
connected to

 the service.  I am saving the client list in txt file and it shows this;

 [04/10/2006 17:24:09:296] --D Activa[0] IP [] PORT []
 [04/10/2006 17:24:09:296] --D Activa[1] IP [] PORT []
 [04/10/2006 17:24:09:296] --D Activa[2] IP [] PORT []
 [04/10/2006 17:24:09:296] --D Activa[3] IP [10.10.10.237] PORT [2379]

 What happen with the positions 0,1 and 2 that shows no port or ip??

 I have found this exception 2 segs before the addition of a new 
'empty´(no

 ip or port) connection and was capture in WSocketServerExBgException.

 [04/10/2006 17:24:07:453] [ESocketException] Msg[Error 10038 in function
 Disconnect (closesocket)
 Socket operation on non-socket]

 Is there a relationship between this exception and the addition of the 
new

 empty connection? or I have to look for the error in another place.
 Any help would be appreciated.

 Thank you

 Miguel Angel Cañas C.

 _
 Express yourself instantly with MSN Messenger! Download today it's FREE!
 http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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


_
Express yourself instantly with MSN Messenger! Download today it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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

Re: [twsocket] TWsocket server client list Error

2006-10-05 Thread Fastream Technologies
Yes we have the same problem even though no exceptions are raised. This 
occurs with high traffic--especially sockets disconnecting with 
errors/abort.

Regards,

SZ

- Original Message - 
From: Miguel Cañas [EMAIL PROTECTED]
To: twsocket@elists.org
Sent: Thursday, October 05, 2006 4:37 PM
Subject: Re: [twsocket] TWsocket server client list Error


: Thank you for the answer Wilfried
:
: Im following your suggestios and I will test the Wsockets events today 
with
: try .. except blocks to try to find the error.
:
: However I want to ask something to, Is there a theory for the connections
: without IP and PORT that shows the TWsocketServer.client[i]?
:
: [04/10/2006 17:24:09:296] --D Activa[1] IP [] PORT []
:
: because I have a procedure that check for connections to make a close 
socket
: in case that some timeotu expired, the code looks like this:
:
: //check for a valid client
:if WSocketServerEx.IsClient( WSocketServerEx.Client[ i ] ) then
:begin
: //Close socket. Nothing send.
:  TTcpSrvClient( WSocketServerEx.Client[ i ] ).Close;
:   end;
: I can see thar in the case of the no IP no port connections i can do a
: .Close call
:
: Thank you
:
: Miguel Angel Cañas C.
:
:
: From: Wilfried Mestdagh [EMAIL PROTECTED]
: Reply-To: ICS support mailing twsocket@elists.org
: To: ICS support mailing twsocket@elists.org
: Subject: Re: [twsocket] TWsocket server client list Error
: Date: Thu, 5 Oct 2006 12:42:03 +0200
: 
: Hello Miguel,
: 
: BGException is background exception. It comes from the message pump.
: This means it can come also from your code in one of the TWSocket
: events. To test put them all in a exception block until you found the
: error (if it is over there of course).
: 
: Socket operation on a non socket means that somewhere some handle is
: overwritten. Mostly this comes because you have somewhere written
: outside a variable (so written [partly] to another).
: 
: This is not nececary the same moment but has happend a little while
: before it.
: 
: Also possible is that you have a pointer to a datasocket that is not
: exestant anymore. If you have an array of sockets or so, be sure to
: update it on OnClientConnect / OnClientDisconnect. Remember also that in
: OnClientDisconnect the datasocket in question is still there, it is
: called before it is destroyed (also the count argument).
: 
: ---
: Rgds, Wilfried [TeamICS]
: http://www.overbyte.be/eng/overbyte/teamics.html
: http://www.mestdagh.biz
: 
: Thursday, October 5, 2006, 09:06, Miguel Cañas wrote:
: 
:   Hi
: 
:   I am using TwSocketServer in a service application that receives
: information
:   from a POS Machine (using TCP) and I am having problems with the 
number
: of
:   clients that shows WSocketServerEx.ClientCount. In some cases
: clientcount
:   return more connections than the number of machines that I have
: connected to
:   the service.  I am saving the client list in txt file and it shows 
this;
: 
:   [04/10/2006 17:24:09:296] --D Activa[0] IP [] PORT []
:   [04/10/2006 17:24:09:296] --D Activa[1] IP [] PORT []
:   [04/10/2006 17:24:09:296] --D Activa[2] IP [] PORT []
:   [04/10/2006 17:24:09:296] --D Activa[3] IP [10.10.10.237] PORT [2379]
: 
:   What happen with the positions 0,1 and 2 that shows no port or ip??
: 
:   I have found this exception 2 segs before the addition of a new
: 'empty´(no
:   ip or port) connection and was capture in WSocketServerExBgException.
: 
:   [04/10/2006 17:24:07:453] [ESocketException] Msg[Error 10038 in 
function
:   Disconnect (closesocket)
:   Socket operation on non-socket]
: 
:   Is there a relationship between this exception and the addition of the
: new
:   empty connection? or I have to look for the error in another place.
:   Any help would be appreciated.
: 
:   Thank you
: 
:   Miguel Angel Cañas C.
: 
:   _
:   Express yourself instantly with MSN Messenger! Download today it's 
FREE!
:   http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
: 
: 
: --
: 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
:
: _
: Express yourself instantly with MSN Messenger! Download today it's FREE!
: http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
:
:





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


Re: [twsocket] TWsocket server client list Error

2006-10-05 Thread Wilfried Mestdagh
Hello Miguel,

 However I want to ask something to, Is there a theory for the connections
 without IP and PORT that shows the TWsocketServer.client[i]?

No I have no theory at the momen. With empty  IP and Port, which
properties do you exacly mean ?

 in case that some timeotu expired, the code looks like this:

Code looks OK to me.

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

Thursday, October 5, 2006, 15:37, Miguel Cañas wrote:

 Thank you for the answer Wilfried

 Im following your suggestios and I will test the Wsockets events today with
 try .. except blocks to try to find the error.

 However I want to ask something to, Is there a theory for the connections
 without IP and PORT that shows the TWsocketServer.client[i]?

 [04/10/2006 17:24:09:296] --D Activa[1] IP [] PORT []

 because I have a procedure that check for connections to make a close socket
 in case that some timeotu expired, the code looks like this:

 //check for a valid client
 if WSocketServerEx.IsClient( WSocketServerEx.Client[ i ] ) then
 begin
  //Close socket. Nothing send.
   TTcpSrvClient( WSocketServerEx.Client[ i ] ).Close;
end;
 I can see thar in the case of the no IP no port connections i can do a
 .Close call

 Thank you

 Miguel Angel Cañas C.


From: Wilfried Mestdagh [EMAIL PROTECTED]
Reply-To: ICS support mailing twsocket@elists.org
To: ICS support mailing twsocket@elists.org
Subject: Re: [twsocket] TWsocket server client list Error
Date: Thu, 5 Oct 2006 12:42:03 +0200

Hello Miguel,

BGException is background exception. It comes from the message pump.
This means it can come also from your code in one of the TWSocket
events. To test put them all in a exception block until you found the
error (if it is over there of course).

Socket operation on a non socket means that somewhere some handle is
overwritten. Mostly this comes because you have somewhere written
outside a variable (so written [partly] to another).

This is not nececary the same moment but has happend a little while
before it.

Also possible is that you have a pointer to a datasocket that is not
exestant anymore. If you have an array of sockets or so, be sure to
update it on OnClientConnect / OnClientDisconnect. Remember also that in
OnClientDisconnect the datasocket in question is still there, it is
called before it is destroyed (also the count argument).

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

Thursday, October 5, 2006, 09:06, Miguel Cañas wrote:

  Hi

  I am using TwSocketServer in a service application that receives 
information
  from a POS Machine (using TCP) and I am having problems with the number
of
  clients that shows WSocketServerEx.ClientCount. In some cases 
clientcount
  return more connections than the number of machines that I have 
connected to
  the service.  I am saving the client list in txt file and it shows this;

  [04/10/2006 17:24:09:296] --D Activa[0] IP [] PORT []
  [04/10/2006 17:24:09:296] --D Activa[1] IP [] PORT []
  [04/10/2006 17:24:09:296] --D Activa[2] IP [] PORT []
  [04/10/2006 17:24:09:296] --D Activa[3] IP [10.10.10.237] PORT [2379]

  What happen with the positions 0,1 and 2 that shows no port or ip??

  I have found this exception 2 segs before the addition of a new 
'emptyŽ(no
  ip or port) connection and was capture in WSocketServerExBgException.

  [04/10/2006 17:24:07:453] [ESocketException] Msg[Error 10038 in function
  Disconnect (closesocket)
  Socket operation on non-socket]

  Is there a relationship between this exception and the addition of the
new
  empty connection? or I have to look for the error in another place.
  Any help would be appreciated.

  Thank you

  Miguel Angel Cañas C.

  _
  Express yourself instantly with MSN Messenger! Download today it's FREE!
  http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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

 _
 Express yourself instantly with MSN Messenger! Download today it's FREE!
 http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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


Re: [twsocket] TWsocket server client list Error

2006-10-05 Thread Wilfried Mestdagh
Hello Fastream,

But if a client disconnect with an error in high traffic, which events
are you logging ?  Seems a wierd problem to me...

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


Re: [twsocket] TWsocket server client list Error

2006-10-05 Thread Fastream Technologies
It seems the Client[] is not up to date. Perhaps we should remove the client 
from there when the disconnect signal is received? (not when the object is 
destroyed?)

Best Regards,

SubZero

- Original Message - 
From: Wilfried Mestdagh [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Thursday, October 05, 2006 5:01 PM
Subject: Re: [twsocket] TWsocket server client list Error


: Hello Fastream,
:
: But if a client disconnect with an error in high traffic, which events
: are you logging ?  Seems a wierd problem to me...
:
: ---
: 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