473,394 Members | 1,750 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Client application: Can't close a Socket!

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
1 1787
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

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

Similar topics

2
by: WIWA | last post by:
Hi, I want to make a UDP client server application that is conform to RFC868 (Time protocol). Both the UDP client and UDP server are in a test phase. The question is: when I add ...
2
by: learning_C++ | last post by:
Hi, I found some example code about server and client applications. But I can not run server and client in different computers. Now, I only run them in the different windows in Linux. I hope to...
0
by: netgeni59 | last post by:
Hello fellow C# friends, I am trying to write a C# TCP client that was formerly written in Java. The server must still remain in Java. I cannot get text data from the C# client to be received...
8
by: Claire | last post by:
I'm trying to debug my network application ie I want to check my error handling when the connection is broken. Im using 127.0.0.1 as the connection address. Unfortunately, the client socket goes...
4
by: rs | last post by:
how I the client tell the server that the socket is closed? or this there an even that informs the server that the clients socket is close? Oh, I am using vb.net 2003 Thanks
2
by: Sparky74 | last post by:
Hi. Can somebody please help me - I cannot get my TCP client application to close its socket one I attempt a send. It will close the socket fine if I don't call Send or BeginSend. Soon as I do, it...
1
by: Miroslav Endys | last post by:
I have two apps. Client and Server (both are windows console apps). Im using Client Socket of this definition AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp and Im using async...
0
by: sarahnetworking | last post by:
Hello, I have developed a client server application using C. i have a list of usernames and a list of passwords in a text file. i need to be able to do 2 loops so i can send the usernames and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.