| Dart Home | PowerTCP Sockets for .NET | Custom Development | Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums |
| Author | Forum: PowerTCP Sockets for .NET (Secure and Standard) Topic: Client Disconnect Problem |
| jonmalda From: burlington, ON USA Posts: 13 Member Since: 10/01/03 |
posted October 1, 2003 10:41 AM Hi. I am building an application using the Server classes. Currently my app is a win32 app while I am building and testing it. But, when complete, will be ported to a Windows Service (thus I am using the Server Class, and not the forms controls). I have built a server that accepts incoming connections. My solution is a little unique in that my Listener keeps track of the connections via its own connection collection. This is done because I need some properties and methods available at the connection level. Thus I have my own Connection Class which has a Tcp property, and then its own properties, and methods. My Listener uses the Server Class, handles the Server.Connection event, and loads its my Connection Class (sets its Tcp property to the tcp connection making an attempt to connect), adds it to its Connection Collection, and manages it from there. Almost everything works wonderfully. I can connect with multiple clients (I'm using your TCP Client sample), send data, receive data etc. However, when a client disconnects, I receive the following error message at the server side: "Exception has been thrown by the target of an invocation." I cannot trap this error anywhere in my application, and cannot determine what is causing it. As I step through my code, there is no line that causes this error... the error just pops up in a message box... no idea where it comes from. I was wondering if I could send one of you my simple .NET C# project, and you could have a look at it? My code with the above explanation will probably make the problem, and my reason for coding the app the way I have a little more clear. Thanks in advance, Jon |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 1, 2003 3:07 PM Please contact sales@dart.com to discuss support options that include code analysis. |
| jonmalda From: burlington, ON USA Posts: 13 Member Since: 10/01/03 |
posted October 1, 2003 4:06 PM Thanks Tony... As info - I've done more sleuthing around, and discovered that the error does not occur as long as the server has sent some data back to the client before the client shuts down the socket connection. However, if the client closes the connection before receiving any data, voila, the error occurs. Interesting... Any idea why this would happen? |
Tony Priest![]() From: Utica, NY USA Posts: 8466 Member Since: 04/11/00 |
posted October 1, 2003 4:17 PM No, but now that you know that. It should be pretty easy to create a simple project that duplicates the error. Try modifying one of our server samples. If you are able to easily recreate the problem with a few mods to one our samples, tell me what they are and I'll see if I can duplicate it here. |
| Reply | PowerTCP Sockets for .NET (Secure and Standard) Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|