Hello Wilfried, >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.
Sorry, I will remember next time... The OnSessionClosed is never fired in this case (when the host disconnects), I don't know why. I think it's because this kind of use is non standard (I want a 'permanent' connection with the printer, port 9100). It's perhaps also due to the printer itself. At this time I followed François's advice, I send some datas and wait for the answer. If I have no answer, I disconnect and try to reconnect and so until I have a connection... It seems to work, but it would be interesting to understand why I don't get any info at the socket side when I power off the printer for example... (Timeout to long, or something like this ?) Thanks 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] * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * -----Message d'origine----- De : [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] De la part de Wilfried Mestdagh Envoyé : jeudi 17 août 2006 09:13 À : ICS support mailing Objet : :-(( 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 -- 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