Login  
Search All Forums
Dart Home | PowerTCP Emulation for .NET | Custom Development Reply | PowerTCP Emulation for .NET Topics | Forums   
AuthorForum: PowerTCP Emulation for .NET
Topic: An Existing connection was forcibly closed by host -- AGAIN
mattwisner

From: Irving, TX USA
Posts: 3
Member Since: 06/25/04
posted June 28, 2004 12:15 AM

I'm having this same problem and could not find any more info about this topic so I'm reopening this thread.

I've got everything working (even by reference and adding my event handlers). Telnet.Connect() works and everything looks good until I logoff. Now from my socket programming days I know a little about what's going on here:

1) I'm ready to end my session so I enter "logoff"
2) my telnet client (Vt.Telnet) sends "logoff" to the server without knowing it's meaning
3) the server, however, sees "logoff" and says "make it so" and closes the socket connection
4) any good socket client knows that when a network receive, recv(), returns 0 that the connection was closed by the other side and the socket handle is stale.

How do I detect a recv() = 0 so I can close the telnet connection?

TIA,
Matt
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted June 28, 2004 9:05 AM

I just tried the sample Telnet client and it got a ConnectedChanged after I typed "logout".

Do you have a pending Receive at all times?

mattwisner

From: Irving, TX USA
Posts: 3
Member Since: 06/25/04
posted June 28, 2004 1:43 PM


Hi Tony,
Yes. I get the ConnectionChanged event when I logout but then I get the "An existing connection was forcibly closed by host" right after it.

Do I need to do something in my ConnectionChanged handler? I've already tried Vt.Telnet.Close(), setting the Vt object to null, GC'ing the Vt and/or Telnet objects.....

The $20,000 quesiton is how to I catch the exception that the Async BeginReceive will throw when I never -directly- called it? I think that is my problem. 

Thanks for your help,
Matt
Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted June 28, 2004 1:52 PM

What is giving you the error? I don't see that in the sample app.

Reply | PowerTCP Emulation for .NET Topics | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX