Server Cannot Detect that the Client is disconnected, why?

From what I've read, in order to make server "know" that a client is disconnected, you have to make server "write" to client socket to eventually catch an ioexception.
So I write a simple server program and a simple client program. The server "writes" to the client every 10 secs. Now I start the server and client, I can tell on the client side that for about every 10 secs, the client gets the message.
Now I terminate the client program. The server still keeps writing to the client. It's my understanding that after 1 min or so I should see an ioexception. However, 10 minutes passed and the server still keeps writing...
Why is this happening? Did I miss something?

I think it happens because the port is still open
even after the client is closed.And you should not
get IOException when you send a packet over a open
port.Err, no, you should get a SocketException when you send data to a port which has already been closed or reset by the peer.

Similar Messages

  • RDS 2012 - Slow Perforamance, random disconnects - The RDP protocol component X.224 detected an error (0) in the protocol stream and the client was disconnected.

    We have an RDS environment configured on server 2012 with approx. 20 users connecting for remote app utilization across 4 different locations that are connected via VPN. Server 2012 has great resources from the virtual host so system resource allocation
    shouldn't be an issue. I'm thinking these errors are correlating with the performance problems. Any recommendations on how to effectively end these errors or to boost performance?
    RDS Log File
    Log Name:      Microsoft-Windows-RemoteDesktopServices-RdpCoreTS/Operational
    Source:        Microsoft-Windows-RemoteDesktopServices-RdpCoreTS
    Date:          3/3/2015 7:47:51 PM
    Event ID:      97
    Task Category: RemoteFX module
    Level:         Warning
    Keywords:     
    User:          NETWORK SERVICE
    Computer:      REMOTE1.mzltg.local
    Description: The RDP protocol component X.224 detected an error (0) in the protocol stream and the client was disconnected.
    System Log Error Log Name:      System
    Source:        Schannel
    Date:          3/4/2015 10:42:02 AM
    Event ID:      36887
    Task Category: None
    Level:         Error
    Keywords:     
    User:          SYSTEM
    Computer:      REMOTE1.mzltg.local
    Description: A fatal alert was received from the remote endpoint. The TLS protocol defined fatal alert code is 49.

    Hi Shane,
    Do you have any progress at the moment?
    Regarding the TLS error code 49, it indicates a valid certificate was received, but when access control was applied, the sender did not proceed with negotiation.
    More information for you:
    SSL/TLS Alert Protocol & the Alert Codes
    http://blogs.msdn.com/b/kaushal/archive/2012/10/06/ssl-tls-alert-protocol-amp-the-alert-codes.aspx
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Async tcp client and server. How can I determine that the client or the server is no longer available?

    Hello. I would like to write async tcp client and server. I wrote this code but a have a problem, when I call the disconnect method on client or stop method on server. I can't identify that the client or the server is no longer connected.
    I thought I will get an exception if the client or the server is not available but this is not happening.
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    How can I determine that the client or the server is no longer available?
    Server
    public class Server
    private readonly Dictionary<IPEndPoint, TcpClient> clients = new Dictionary<IPEndPoint, TcpClient>();
    private readonly List<CancellationTokenSource> cancellationTokens = new List<CancellationTokenSource>();
    private TcpListener tcpListener;
    private bool isStarted;
    public event Action<string> NewMessage;
    public async Task Start(int port)
    this.tcpListener = TcpListener.Create(port);
    this.tcpListener.Start();
    this.isStarted = true;
    while (this.isStarted)
    var tcpClient = await this.tcpListener.AcceptTcpClientAsync();
    var cts = new CancellationTokenSource();
    this.cancellationTokens.Add(cts);
    await Task.Factory.StartNew(() => this.Process(cts.Token, tcpClient), cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);
    public void Stop()
    this.isStarted = false;
    foreach (var cancellationTokenSource in this.cancellationTokens)
    cancellationTokenSource.Cancel();
    foreach (var tcpClient in this.clients.Values)
    tcpClient.GetStream().Close();
    tcpClient.Close();
    this.clients.Clear();
    public async Task SendMessage(string message, IPEndPoint endPoint)
    try
    var tcpClient = this.clients[endPoint];
    await this.Send(tcpClient.GetStream(), Encoding.ASCII.GetBytes(message));
    catch (Exception exception)
    private async Task Process(CancellationToken cancellationToken, TcpClient tcpClient)
    try
    var stream = tcpClient.GetStream();
    this.clients.Add((IPEndPoint)tcpClient.Client.RemoteEndPoint, tcpClient);
    while (!cancellationToken.IsCancellationRequested)
    var data = await this.Receive(stream);
    this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    private async Task Send(NetworkStream stream, byte[] buf)
    await stream.WriteAsync(BitConverter.GetBytes(buf.Length), 0, 4);
    await stream.WriteAsync(buf, 0, buf.Length);
    private async Task<byte[]> Receive(NetworkStream stream)
    var lengthBytes = new byte[4];
    await stream.ReadAsync(lengthBytes, 0, 4);
    var length = BitConverter.ToInt32(lengthBytes, 0);
    var buf = new byte[length];
    await stream.ReadAsync(buf, 0, buf.Length);
    return buf;
    Client
    public class Client
    private TcpClient tcpClient;
    private NetworkStream stream;
    public event Action<string> NewMessage;
    public async void Connect(string host, int port)
    try
    this.tcpClient = new TcpClient();
    await this.tcpClient.ConnectAsync(host, port);
    this.stream = this.tcpClient.GetStream();
    this.Process();
    catch (Exception exception)
    public void Disconnect()
    try
    this.stream.Close();
    this.tcpClient.Close();
    catch (Exception exception)
    public async void SendMessage(string message)
    try
    await this.Send(Encoding.ASCII.GetBytes(message));
    catch (Exception exception)
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    private async Task Send(byte[] buf)
    await this.stream.WriteAsync(BitConverter.GetBytes(buf.Length), 0, 4);
    await this.stream.WriteAsync(buf, 0, buf.Length);
    private async Task<byte[]> Receive()
    var lengthBytes = new byte[4];
    await this.stream.ReadAsync(lengthBytes, 0, 4);
    var length = BitConverter.ToInt32(lengthBytes, 0);
    var buf = new byte[length];
    await this.stream.ReadAsync(buf, 0, buf.Length);
    return buf;

    Hi,
    Have you debug these two applications? Does it go into the catch exception block when you close the client or the server?
    According to my test, it will throw an exception when the client or the server is closed, just log the exception message in the catch block and then you'll get it:
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.Invoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    Console.WriteLine(exception.Message);
    Unable to read data from the transport connection: An existing   connection was forcibly closed by the remote host.
    By the way, I don't know what the SafeInvoke method is, it may be an extension method, right? I used Invoke instead to test it.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Czn't download Calendar from cableone?? The page isn't redirecting properly Firefox has detected that the server is redirecting the request

    Cannot download Calendar from cableone.net???
    The page isn't redirecting properly
    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    Does this happen on just one site or does it happen more often?<br>
    First I would delete the contents of the cache and delete all current cookies and try again. If clearing does not help, I would try safe mode.<br>
    Did you try to start Firefox in the Firefox Safe Mode? If it works when in safe mode, then this problem is probably caused by a broken add-on. If the safe mode does not help, that may be an indication that the server is sending some broken headers.

  • I am able to load some pages from a particular website while other pages from the same site give the error "Firefox has detected that the server is redirecting the request for this address in a way that will never complete."

    I am able to access some directories on the website without any problems while I get the "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." error for other directories of the same site.
    == URL of affected sites ==
    http://www.safelistgrande.com

    Suddenly from yesterday I am getting this error while trying to opening gmail

  • How can I display the front panel of the dinamically loaded VI on the cliente computer, the VI dinamically loaded contains files, I want to see the files that the server machine has, in the client machine

    I can successfully view and control a VI remotly. However, the remote VI dinamically loads another VI, this VI loaded dinamically is a VI that allows open others VIs, I want to see the files that contains the server machine, in the client machine, but the front panel of the dinamic VI appears only on the server and not on the client, How can I display the fron panel with the files of the server machine of the dinamically loaded VI on the client computer?
    Attachments:
    micliente.llb ‏183 KB
    miservidor.llb ‏186 KB
    rdsubvis.llb ‏214 KB

    I down loaded your files but could use some instructions on what needs run.
    It seems that you are so close yet so far. You need to get the data on the server machine over to the client. I generally do this by doing a call by reference (on the client machine) of a VI that is served by the server. THe VI that executes on the server should pass the data you want to diplay via one of its output terminals. You can simply wire from this terminal (back on the client again) to an indicator of your choosing.
    Now theorectically, I do not think that there is anything that prevents use from getting the control refnum of the actual indicator (on the server) of the indicator that has the data, and read its "Value" using a property node. I have never tried this idea but it seems t
    hat all of the parts are there. You will need to know the name of the VI that holds the data as well as the indicator's name. You will also have to serve all VI's. This is not a good idea.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    keep getting this error:
    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
    I've also tried in IE and got this page can not be displayed.
    Cleared cache, deleted cookies.
    I'm trying to access grrlzrock.com I was using it about an hour ago, and now it doesn't work. any idea?

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    *Tools > Options > Advanced > Network > Cached Web Content: "Clear Now"
    "Remove Cookies" from sites causing problems:
    *Firefox/Tools > Options > Privacy > Cookies: "Show Cookies"
    *http://kb.mozillazine.org/Cookies
    *https://support.mozilla.org/kb/Deleting+cookies
    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Google calendar is getting the error "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." I have tried disabling cookies, clearing cookies and cache but that didn't work.

    Google calendar is getting the error "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." I have tried disabling cookies, clearing cookies and cache but that didn't work.

    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"
    * http://kb.mozillazine.org/The_page_is_not_redirecting_properly

  • Firefox has detected that the server is redirecting the request for this address in a way that will never complete. * This problem can sometimes be caused by disabling or refusing to accept cookies.

    Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
    * This problem can sometimes be caused by disabling or refusing to accept
    cookies.

    In my experience this is most of the times a server issue of the website provider.
    Does this error occur on all Websites or just one specific Website?
    Does this Website load in Internet Explorer (or any other Browser?)?

  • I have downloaded firefox but when I open it I get the following message 'Firefox has detected that the server is redirecting the request for this address in a way that will never complete'. What do I do?

    I have downloaded firefox but when I open it I get the following message 'Firefox has detected that the server is redirecting the request for this address in a way that will never complete'. What do I do?

    See:
    * http://kb.mozillazine.org/The_page_is_not_redirecting_properly
    Clear the cache and the cookies from sites that cause problems.
    * "Clear the Cache": Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    * "Remove the Cookies" from sites causing problems: Tools > Options > Privacy > Cookies: "Show Cookies"

  • Load the document in Firefox (click gmail "Documents") error: The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    load document in Firefox (clicking gmail "Documents", error: "The page isn't redirecting properly. Firefox has detected that the server is redirecting the request for this address in a way that will never complete.

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    * http://kb.mozillazine.org/The_page_is_not_redirecting_properly

  • "The page isn't redirecting properly, Firefox has detected that the server is redirecting the request for this address that will never complete" has anyone come across this staement?

    This statement pops up on some occasions when I am sending an Email, but the Emails are usually received by the recipient! who are mostly Family so I have been able to check that that have been read.

    Hi mawhitehead,
    try these
    * '''The page is not redirecting properly''' - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/The_page_is_not_redirecting_properly
    * '''Network.http.redirection-limit''' - MozillaZine Knowledge Base<br>http://kb.mozillazine.org/Network.http.redirection-limit
    * I am unable to access my gmail calender. It states that refused because of cookies being blocked.<br>https://support.mozilla.com/en-US/questions/786049
    * tried posting new thread on sourceforge shareaza forums, firefox gives problem loading page, <br>https://support.mozilla.com/en-US/questions/757368
    * Firefox has issues redirecting, cookies are all on, I think I voided my warranty. <br>https://support.mozilla.com/en-US/questions/755435
    * firefox message: &quot;The page isn't redirecting properly&quot; Firefox has detected that the server is redirecting the request for this address in a way that will never complete.<br>https://support.mozilla.com/en-US/questions/695393

  • WhenI send an email the following appears, the page isn`t redirecting properly, firefox has detected that the server is redirecting the request for this address in a way that will never complete

    firefox has detected that the server is redirecting the request for this address in a way that will never complete

    This issue can be caused by corrupted cookies.
    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    See also:
    * http://kb.mozillazine.org/The_page_is_not_redirecting_properly

  • Hierarchy monitoring detected that the ConfigMgr SQL Server ports 1433,4022, are not active on Firewall exception

    SMS_HIERARCHY_MANAGER reports (Message ID=3353):
    "Hierarchy Monitoring detected that the ConfigMgr SQL Server <fqdn> ports 1433,4022, are not active on Firewall
    exception."
    This is a fresh SCCM 2012 environment with no firewall active. SQL is installed on the same server as SCCM 2012.  Is there a way to fix this without enabling the firewall?

    Check this out
    Issue:
    ConfigMgr logs the error even though Windows Firewall is disabled or it is enabled and all exceptions are added to SQL Server(s).
    Environment: I had an environment  consist of a two node SQL Cluster hosting ConfigMgr database and a separate ConfigMgr primary site server
    Resolution:
    Windows firewall service must be started on both SQL nodes and ConfigMgr itself . As soon as the service is started exceptions for TCP 1433 and 4022 must be added to SQL nodes firewall.
    After that the firewall profiles can be disabled using:
    netsh advf set allp state off
    This is true but if you disable the firewall even thought you have opened the Firewall port then disabled the firewall. The status message will continue to be generated and your site server will still be in an error state.
    Notice that I said "disabled" and not "turn off".
    Garth Jones | My blogs: Enhansoft and
    Old Blog site | Twitter:
    @GarthMJ

  • I can't access Facebook. I keep getting the "Firefox has detected that the server is redirecting the request for this address in a way that will never complete". I have cleared cache, cookies, history, offline storage. Nothing has worked.

    can't access Facebook. I keep getting the "Firefox has detected that the server is redirecting the request for this address in a way that will never complete". I have cleared cache, cookies, history, offline storage. Nothing has worked.

    Start Firefox in [[Safe Mode]] to check if one of your add-ons is causing your problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    See [[Troubleshooting extensions and themes]] and [[Troubleshooting plugins]]

Maybe you are looking for

  • ISA Error by running an application in JDeveloper 10.1.3

    Hi every body when i run my web application in oc4j( embeded in jdeveloper 10.1.3) I see this error "Error Code: 502 Proxy Error. The ISA Server denied the specified Uniform Resource Locator (URL). (12202) " what's wrong? by thanks Javaneh

  • Backup of mirrored database is not possible?

    Hi Please correct me, backup of mirror database is not possible right? Thanks Shashikala Shashikala

  • Creat 'recurring inspection' in Deadline monitoring of Batches

    Hi guys, Conditions: (1) Today is '11.24.2011''. (2) MSC3N - 'Shelf Life Exp. Date' is '11.30.2011' and 'Next Inspection' is '12.10.2011'. (3) QA07 - 'Initial run in days' is '30' and Check radiobutton at 'To insp.stock at lot creation' in the 'Addit

  • Activation of Public sector management

    we are using ECC6 on our project. the project is based on Phase wise approach. Funds management was not active in Phase 1. but know when we activate public sector management (PSM) the system overwrites the Ledger values in FI. and ask to define new L

  • 11g oim: trusted recon -- status data receive

    Hi Gurus i have written a custom scheduler which fetches data from db and generate events, i am able to generate recon events but all of them are in Data received state,When i reevalute rule i am getting Batch process not complete.I have given batch