By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,320 Members | 2,205 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,320 IT Pros & Developers. It's quick & easy.

Client application: Can't close a Socket!

P: 20
Hi Everybody. I have been searching for many hours for an answer to this problem. I hope somebody can help me.

I have a C# .NET client application that connects to a TCP/IP C++ server application that I have maintained for a number of years.

What I am finding is that Socket.Close() does not actually sever the client connection from my server application.

Actually, my statement above isn't entirely true - Socket.Close() *does* work as long as I don't send any data. The minute I use BeginSend()/EndSend() or Send(), the Socket.Close() call does not disconnect my client from the server application.

Has anybody experienced or resolved this problem before?

I don't get any SocketExceptions or errors.

Cheers
Sparky
Jun 28 '07 #1
Share this Question
Share on Google+
1 Reply


P: 10
Hi Everybody. I have been searching for many hours for an answer to this problem. I hope somebody can help me.

I have a C# .NET client application that connects to a TCP/IP C++ server application that I have maintained for a number of years.

What I am finding is that Socket.Close() does not actually sever the client connection from my server application.

Actually, my statement above isn't entirely true - Socket.Close() *does* work as long as I don't send any data. The minute I use BeginSend()/EndSend() or Send(), the Socket.Close() call does not disconnect my client from the server application.

Has anybody experienced or resolved this problem before?

I don't get any SocketExceptions or errors.

Cheers
Sparky
[HTML]Check for null Socket if socket object ==null then only close or do the same in exception Handling : setiaRakesh[/HTML]
Dec 15 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.