Re: [twsocket] disconnect problem with tcp socket
am building a chat system and when a user is disconnected from there host there id is stuck within the socket so am wondering is there anyway of removing dead IDs once connection is lost to server? In my opinion, the best way to handle this is to implement at the application layer a kind of ping. Your chat system surely use a kind of messaging between client and server. Just implement one more command from server to client: every minute your server send a "noop" command to the client which simply answers "OK". If the client do'nt answer, then assume his connection is lost and cleanup your system. -- 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
Re: [twsocket] Disconnect detection
Hello Frédéric, If you start a new subject pleasd do Not reply to an existing subject but start a new one. It is really not mutch work. > What's the best way to detect a broken connection. When connection will break then OnSessionClosed will fire. There you start a timer and after some seconds or more you try to connect again. If the host is stil not alive OnSessionConnected will fire with a winsock error, then OnSessionClosed without winsock error and you start over again. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Wednesday, August 16, 2006, 21:22, Frédéric SCHENCKEL wrote: > Hello, > I have a TWSocket who connects to a printer. > What's the best way to detect a broken connection. > TWSocket is only waiting for data from the printer (special > printer...) therefore I do a TWSocket.connect. > When the printer is Offline (power off for example) after the > connection is establisched, I cannot detect that the connection is > broken. > What's the best way to detect this ? > Note : the kind of socket component doesn't really mather at this > time. Just for info, linemode is on... > Thanks > Best regards > Frédéric SCHENCKEL > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > cab technologies > za Nord du val de Moder > 67350 Niedermodern > Tél: + 33 3 88 72 25 01 / Fax: +33 3 88 72 25 02 > Notre site en Français: www.cab-technologies.fr > Adresse support: [EMAIL PROTECTED] > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -- 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] Disconnect detection
Keep alive socket option is sometimes a solution. Frequently not. You can send data to your device just to periodically check if it is still alive. 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 - Original Message - From: "Frédéric SCHENCKEL" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Wednesday, August 16, 2006 9:22 PM Subject: [twsocket] Disconnect detection > > Hello, > > > I have a TWSocket who connects to a printer. > > What's the best way to detect a broken connection. > > TWSocket is only waiting for data from the printer (special printer...) therefore I do a TWSocket.connect. > > When the printer is Offline (power off for example) after the connection is establisched, I cannot detect that the connection is broken. > > What's the best way to detect this ? > > Note : the kind of socket component doesn't really mather at this time. Just for info, linemode is on... > > Thanks > > Best regards > > > > > > Frédéric SCHENCKEL > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > cab technologies > za Nord du val de Moder > 67350 Niedermodern > Tél: + 33 3 88 72 25 01 / Fax: +33 3 88 72 25 02 > Notre site en Français: www.cab-technologies.fr > Adresse support: [EMAIL PROTECTED] > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > -- > 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] Disconnect
I had something simular. Let the Client or Server close connection. Maybe try not to close client connection, and let server close the connection when done. - Oorspronkelijk bericht - Van: "Abdullah AlQasim" <[EMAIL PROTECTED]> Aan: Verzonden: donderdag, mei 04, 2006 14:46 Onderwerp: [twsocket] Disconnect > Hello All, > > I am newbie with TWSocket I have some critical problem with my > project : > > My client disconnected with out any reasons some time form Dial-up and > some times form my LAN Server side was built with Java and I am > using TWSocket with our protocol for getting data My client is > working fine parsing data and show it to grids. > > How can I be sure that my client doest not have a problem ... or ether > this problem in Server side? > > Best Regards. > > > -- > 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] Disconnect
Hello Abdullah, You can check winsock error in OnSessionClosed of your client program. If it does have an error and you never call Close(Delayed) in your client then you can assume that server close connection. If you have errorcode then possible it is due to data loss or some firewall interfering. You can eventually download SocketSpy (user made page), and modify it to display witch side is closing. --- Rgds, Wilfried [TeamICS] http://www.overbyte.be/eng/overbyte/teamics.html http://www.mestdagh.biz Thursday, May 4, 2006, 14:46, Abdullah AlQasim wrote: > Hello All, > I am newbie with TWSocket I have some critical problem with my > project : > My client disconnected with out any reasons some time form Dial-up and > some times form my LAN Server side was built with Java and I am > using TWSocket with our protocol for getting data My client is > working fine parsing data and show it to grids. > How can I be sure that my client doest not have a problem ... or ether > this problem in Server side? > Best Regards. -- 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] Disconnect a client from FTPServer...
> I'm trying to code a simple FTPServer using the ICS Demo > as a base. However, I want to be able to disconnect a user via the > server. I see the "FtpServer1.Disconnect()" method but I don't know how > to use it. > Could someone please explain how I would go about using this, > for example, in an onClick method of a button. Thanks in Advance. You must pass the client reference as Disconnect argument. You get this reference either from one on the events, or you can iterate the Client[] property to find the one you want to disconnect. -- 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] Disconnect from FTP Server [FTP Client]
NOOP is a good one. Dan - Original Message - From: "Francois PIETTE" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Monday, May 16, 2005 2:44 PM Subject: Re: [twsocket] Disconnect from FTP Server [FTP Client] >Winsock nor the component will let you know the server disconnected >before you try to send something. So the solution is to periodically >send a >command just to get the error in case the server closed the connection. Note >that periodically sending a command will probably prevent the server >from >closing the connection because it sees activity. Thanks a lot. Which command can you advise to send to check if FTP server is avialable? Any command that do the less possible processing on the server. PWD and SYST are probably the best choices. SYST is not implemented on all servers. Probably sending an invalid command could also be good, just to receive the error "unknown command" or trigger the session closed event. I send "Syst" command (after each one minute), but get an error thought connection was established. Which error ? Maybe the server you use doesn't implement that command. It is possible to get the error when user view some directory - (command "Pwd") and in the same period of time program send command "Syst"? I don't understand what you try to tell me. -- [EMAIL PROTECTED] 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 -- 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] Disconnect from FTP Server [FTP Client]
> > Which error ? Maybe the server you use doesn't implement that > >command. > Yes, similar to it. I need again to test my program. But probably for the purpose of keeping the connection open and knowing when it is closed, it doesn't matter if the server replies it doesn't know the command ! -- [EMAIL PROTECTED] http://www.overbyte.be - Original Message - From: "Artem Antonov" <[EMAIL PROTECTED]> To: "ICS support mailing" Sent: Monday, May 16, 2005 4:43 PM Subject: Re: [twsocket] Disconnect from FTP Server [FTP Client] > On Mon, 16 May 2005 15:44:25 +0200 > "Francois PIETTE" <[EMAIL PROTECTED]> wrote: > > > > Any command that do the less possible processing on the server. PWD > >and SYST > > are probably the best choices. SYST is not implemented on all > >servers. > > Probably sending an invalid command could also be good, just to > >receive the > > error "unknown command" or trigger the session closed event. > > > >> I send "Syst" command (after each one minute), but get an error > >> thought connection was established. > > > > Which error ? Maybe the server you use doesn't implement that > >command. > > > > Yes, similar to it. I need again to test my program. > Thanks for help. > > Best regards, > Artem Antonov. > > -- > 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] Disconnect from FTP Server [FTP Client]
On Mon, 16 May 2005 15:44:25 +0200 "Francois PIETTE" <[EMAIL PROTECTED]> wrote: Any command that do the less possible processing on the server. PWD and SYST are probably the best choices. SYST is not implemented on all servers. Probably sending an invalid command could also be good, just to receive the error "unknown command" or trigger the session closed event. I send "Syst" command (after each one minute), but get an error thought connection was established. Which error ? Maybe the server you use doesn't implement that command. Yes, similar to it. I need again to test my program. Thanks for help. Best regards, Artem Antonov. -- 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] Disconnect from FTP Server [FTP Client]
> >Winsock nor the component will let you know the server disconnected > >before you try to send something. So the solution is to periodically send a > >command just to get the error in case the server closed the connection. Note > >that periodically sending a command will probably prevent the server from > >closing the connection because it sees activity. > Thanks a lot. Which command can you advise to send to check if FTP > server is avialable? Any command that do the less possible processing on the server. PWD and SYST are probably the best choices. SYST is not implemented on all servers. Probably sending an invalid command could also be good, just to receive the error "unknown command" or trigger the session closed event. > I send "Syst" command (after each one minute), but get an error > thought connection was established. Which error ? Maybe the server you use doesn't implement that command. > It is possible to get the error when user view some directory - > (command "Pwd") and in the same period of time program send command > "Syst"? I don't understand what you try to tell me. -- [EMAIL PROTECTED] 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] Disconnect from FTP Server [FTP Client]
On Mon, 16 May 2005 14:46:27 +0200 "Francois PIETTE" <[EMAIL PROTECTED]> wrote: Winsock nor the component will let you know the server disconnected before you try to send something. So the solution is to periodically send a command just to get the error in case the server closed the connection. Note that periodically sending a command will probably prevent the server from closing the connection because it sees activity. -- [EMAIL PROTECTED] http://www.overbyte.be Thanks a lot. Which command can you advise to send to check if FTP server is avialable? I send "Syst" command (after each one minute), but get an error thought connection was established. It is possible to get the error when user view some directory - (command "Pwd") and in the same period of time program send command "Syst"? Best regards, Artem Antonov. -- 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] Disconnect from FTP Server [FTP Client]
> 1) Client connects to the FTP server > 2) After timeout or in the case of connection error FTP server close > connection > 3) FTP client recieve (immediately) message that FTP server is not > avialable > 4) Other actions on the side of client > > How I can realaize the 3) step? > Does anybody solved such problem and which solutions are avialable? Winsock nor the component will let you know the server disconnected before you try to send something. So the solution is to periodically send a command just to get the error in case the server closed the connection. Note that periodically sending a command will probably prevent the server from closing the connection because it sees activity. -- [EMAIL PROTECTED] 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