A
Amit Yadav
Hi,
I am trying to write a simple TCP Client Server program
which exchange some text messages.
Both of my Client and Server are running on the same
machine and hence i am using "localhost" when connecting
from the client side.
However i am getting the following Exception:
System.Net.Sockets.SocketException: No connection could
be made because the target machine actively refused it
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Net.Sockets.TcpClient.Connect(IPEndPoint
remoteEP)
at System.Net.Sockets.TcpClient.Connect(IPAddress
address, Int32 port)
at System.Net.Sockets.TcpClient.Connect(String
hostname, Int32 port)
at System.Net.Sockets.TcpClient..ctor(String hostname,
Int32 port)
The Code is :
TcpClient client = new TcpClient("localhost",11000);
Can anybody explain what's going on and how do i correct
this ?
Thanks.
Amit.
I am trying to write a simple TCP Client Server program
which exchange some text messages.
Both of my Client and Server are running on the same
machine and hence i am using "localhost" when connecting
from the client side.
However i am getting the following Exception:
System.Net.Sockets.SocketException: No connection could
be made because the target machine actively refused it
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Net.Sockets.TcpClient.Connect(IPEndPoint
remoteEP)
at System.Net.Sockets.TcpClient.Connect(IPAddress
address, Int32 port)
at System.Net.Sockets.TcpClient.Connect(String
hostname, Int32 port)
at System.Net.Sockets.TcpClient..ctor(String hostname,
Int32 port)
The Code is :
TcpClient client = new TcpClient("localhost",11000);
Can anybody explain what's going on and how do i correct
this ?
Thanks.
Amit.