How to properly close a client socket in a chat program

Posted 15 October 2013 - 09:21 AM

Im tweaking a basic chat application i found on the internet which includes a server and the client i will provide dl links to the vb files. The bug is when you connect to the server and click the exit server button it does not close the socket properly and causes the client to spaz out and the server makes an error. I want to be able to close the clients connection to the server without causing an error. I'm new to server code in vb so help would be appreciated. the two things i tweaked so far i made a custom ip textbox for joining WAN servers and the exit button which doesn't work properly.

Re: How to properly close a client socket in a chat program

Posted 15 October 2013 - 09:52 AM

Okay.. so put a break point at the top of that function and step through your code. What collection/object are you trying to access out of the range of available indexes? Since your screen shot doesn't show line numbers I am taking a stab and say line 101 is probably something around:

Re: How to properly close a client socket in a chat program

Posted 16 October 2013 - 03:18 PM

modi123_1, on 15 October 2013 - 12:22 PM, said:

I am unclear - is that in response to my post, or another one?

Ive tried looking at both the client and the server the small piece i posted above was for the client. I believe the flaw is all server sided. I have tried debugging at the lines you suggested and that is indeed where the problem is but im not sure how i could possibly fix it. I was under the impression i could simply just throw in a couple of on error resume next's but that didnt work.

This post has been edited by panzerfaust67: 16 October 2013 - 03:19 PM