Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

error connecting to another workstation via TcpClient

Status
Not open for further replies.

vatawna

Programmer
Joined
Feb 24, 2004
Messages
67
Location
US
I created an object client = new TcpClient()
Then try to connect to another workstation via

client.Connect(System.Net.IPAddress.Parse("192.168.1.3"), 1000);

I got the error message "No connection could be made because the target machine actively refused it".

My and the other workstation are both on the same network, and have the Windows Firewall off. I can also ping the other workstation from mine successfully.

Does anybody know how to fix this?

Thanks.
 
Is the other computer set up to be a server?
 
The other computer is not a server. The code that runs on the other computer is as follows:

listener = new TcpListener(System.Net.IPAddress.Parse("192.168.1.159"), 1000);
listener.Start();
while (true)
{
try
{
client = listener.AcceptTcpClient();
...
}
}
 
That would make it the server in this case :)


I think you might find TCP information if you download the 101 code samples. I believe its in the Advanced section.

You can also find 101 Code Samples for VS.Net 2003 but not at that link - that one's only 2005
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top