0

I followed a short tutorial on socket programming and ended up being able to send data to myself on the same computer. Now I want to be able to send data to another computer in my house.

This is how I have set up the endpoints.

Server:

    IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
    IPAddress ipAdress = host.AddressList[0];
    IPEndPoint localEndPoint = new IPEndPoint(ipAdress, 11000);

Client:

    IPHostEntry host = Dns.GetHostEntry(Dns.GetHostName());
    IPAddress ipAdress = host.AddressList[0];
    IPEndPoint remoteEndPoint = new IPEndPoint(ipAdress, 11000);

I thought all I would have to do is set the IP on the client to the IP of the receiving computer like this:

    IPAddress ipAdress = IPAddress.Parse("192.168.200.97");
    IPEndPoint remoteEndPoint = new IPEndPoint(ipAdress, 11000);

but that doesn't seem to work. When I try it it says that the server is actively refusing connection.

Lumina
  • 1
  • 1
  • 3
    Mark sure the software **firewall** on your server is turned off. WindowsKey --> Type Firewall --> Turn it off Temporarily. – Idle_Mind Jun 01 '19 at 15:09
  • This might help -> https://stackoverflow.com/questions/2972600/no-connection-could-be-made-because-the-target-machine-actively-refused-it – Gojira Jun 01 '19 at 16:40
  • None of this seems to work :/ I am using the same exact project on both computers not sure if that makes a difference at all. – Lumina Jun 03 '19 at 23:12

1 Answers1

0

I figured out what was wrong. The first entry in

IPAddress ipAdress = host.AddressList[0];

didn't give me my own IP address on the server.

Lumina
  • 1
  • 1