473,756 Members | 3,566 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Client Socket Shutdown is not visible on the Server Socket

I have two apps. Client and Server (both are windows console apps).

Im using Client Socket of this definition AddressFamily.I nterNetwork,
SocketType.Stre am, ProtocolType.Tc p
and Im using async communication with the Server Socket.
I have no opened NetworkStream.

In case, I kill my client application (via red cross) the server application
can see, that client has been disconnected.
In case, I shutdown the client socket and close it on the client side, and
then close my client apps, the server cannot see, that the client
application has been disconnected.
WHY???

Thanks
ME

Nov 5 '07 #1
1 1891
On 2007-11-05 00:22:52 -0800, "Miroslav Endys" <ne**@endys.czs aid:
[...]
In case, I kill my client application (via red cross) the server
application can see, that client has been disconnected.
In case, I shutdown the client socket and close it on the client side,
and then close my client apps, the server cannot see, that the client
application has been disconnected.
WHY???
Are you actually calling Socket.Shutdown ()?

It's not really possibly to answer your question without seeing the
code you wrote. For specific advice, you should post a
concise-but-complete sample of code that reliably demonstrates the
problem.

"Concise" means you only include the minimum code required, and
"complete" means you post enough code to compile and run without any
addition effort on someone else's part.

Pete

Nov 5 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
7369
by: Herbert VON GRÜNENWALD | last post by:
hi everyone, i've made a client/server class in C++ and some other to do the same thing in c#. clients and server works fine, in the two langages, but there is one problem when a c++ client disconnect from the c# server: - the connection is OK - when i send a message from the client to the server, no problems (it is received by the server)
0
1462
by: Usman | last post by:
Hi I'm having problem with a scenarion where I have a server written in C# and client written in VC6++. Here is the server code that i'm using including the Callback function for handling clients. Also there's a commented code where i'm using TCPListener instead of simple Socket Class. The problem i'm having is that when I run this code using Socket class, the server starts well but "OnClientConnect" method never gets called. On...
2
6877
by: Macca | last post by:
My app has an asynchronous socket server. It will have 20 clients connected to the server. Each client sends data every 500 millisecondsThe Connections once established will not be closed unless there is a problem with the connection. I need to know which client has sent the incoming data as each client has its own buffer on my "server" app. I am using the standard asynch socket code from MSDN to listen for connections and they...
9
1335
by: diffuser78 | last post by:
My server.py looks like this ---------------------------------------------CODE---------------------------------- #!/usr/bin/env python import socket import sys import os s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) host = ''
4
1319
by: =?Utf-8?B?U2hhdW5P?= | last post by:
Hi, I set up an client to asynchronously receive data from it's connection. When i'm finished, i close the client using try { theClient.SetSocketOptionSocketOptionLevel.Socket,SocketOptionName.NoDelay,1); theClient.Shutdown(SocketShutdown.Both); theClient.Close(); theClient=null;
14
12794
by: ahlongxp | last post by:
Hi, everyone, I'm implementing a simple client/server protocol. Now I've got a situation: client will send server command,header paires and optionally body. server checks headers and decides whether to accept(read) the body. if server decided to throw(dump) the request's body, it'll send back a response message, such as "resource already exists" and close the connection.
2
2082
by: ppuniversal | last post by:
Hi everyone, I have made a client-server code in Linux. The server is running properly and is sitting at its accept() method. But the client is unable to connect to the server. The Server and Client codes are as follows : Filename : Server.cpp #include<sys/types.h> #include<sys/socket.h> #include<netdb.h>
6
4923
by: 7stud | last post by:
My question pertains to this example: #!/usr/bin/env python import socket, sys, time host = sys.argv textport = sys.argv s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
7
4690
by: Anil | last post by:
I have a Javascript program which runs in the browser and has functions work(), and stop(). It listens to commands from the server to work() and can be interrupted by the server to stop(). I am using XmlHttpRequest to talk to the server. So I use http GET to send a command "ready" to the server, which replies at some point in time by sending "work" which is invoked by the callback. As per my understanding, the browser client is single...
0
10034
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9872
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9843
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3358
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2666
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.