Results 1 to 2 of 2

Thread: Connection closed by remote host?

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Aug 2003
    Location
    Edinburgh, UK
    Posts
    2,773

    Connection closed by remote host?

    Hi there.

    I have an SPV C550. I am deving an app in C# using .NET framework 1.1 and VS.NET 2003

    I now recieve a different error message than the part where it could not flush the data.

    "System.IO.IOException:Unable to write data to the transport connection. ---> System.Net.Sockets.SocketException:An existing connection was forcibly closed by the remote host"


    ?

    The connection on the remote host is open and listening to the TCP socket and port. The client based app has resolved the DNS host name and have given it the same port number as the port number the remote host is listening to.

    any ideas?

    Code:
    NetworkStream ns = this.client.GetStream();
    
    			if(ns.CanWrite)
    			{
    				string msg = "hey, its me buddy! the client";
    				byte[] byteMessage = System.Text.Encoding.ASCII.GetBytes(msg.ToCharArray());
    				ns.Write(byteMessage, 0, byteMessage.Length);
    				ns.Flush();
    			}
    Last edited by Techno; Jul 25th, 2005 at 06:26 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width