- Home /
Join Server only works on the same computer, join server does not work between 2 different computers.
I have 2 computers in the same house, on the same wifi. This is a recurring and EXTREMELY frustrating issue. I keep thinking I fixed it, but then I try to play with my brother and he says the join server button isn't doing anything. Sure enough, I tried it and it doesn't work for me either.
All I did was this code.
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Networking;
using System.Collections;
public class NetworkConnector : MonoBehaviour {
public IPAddress ip;
public IPAddress port;
private bool isSetup;
void Start () {
StartCoroutine (Setup ());
}
void Update () {
if (isSetup)
{
if (ip.valid)
{
if (ip.textField.text != "")
{
NetworkManager.singleton.networkAddress = ip.textField.text;
}
}
if (port.valid && port.textField.text != "")
{
NetworkManager.singleton.networkPort = int.Parse (port.textField.text);
}
}
}
public void StartHost () {
NetworkManager.singleton.StartHost ();
}
public void StartClient () {
if (ip.textField.text != "")
{
NetworkManager.singleton.StartClient ();
}
}
IEnumerator Setup () {
yield return new WaitForSeconds (0.1f);
isSetup = true;
}
}
This is ridiculously frustrating and I have posted several questions but then taken them down, because I keep thinking it's fixed but it's not.
I can confirm the ip and port are being set, because the network manager is showing the changes from the input fields in the inspector. Do I have to type in the ip for both client and server? I'm doing that, but why can't I connect? I've tried ports 1234 and 25000. I am using the ip 192.168.1.3 which is my server's ipv4.
@meat5000 I am still stuck and I did check out that hud script you sent me. Does changing the port mess it up?
You should put the port into google to see what it is reserved for, if anything.
Set up port forarding on your router. Try either 5555 or 55555, dont remember which.
@meat5000 hi again,
it says online that ports above 49151 are "dynamic" is that what I'm looking for? does that mean the registered port you mentioned is 5555?
I understand the struggle of uNet and would love to help. Try hosting with your brothers computer and connect with the editor on yours, then check the console for any errors, might give you some useful info, although it will probably just be uNet timeout.
If not, then perhaps its a problem with your LAN? Try port forwarding 1234/25000 or whatever to your LAN ipv4 (192.168.1.3), then get your brother to connect using your public address.
Failing that, you could recreate your networking problem in a new project, then upload it so I can have a look at it and/or see if it works on my LAN (which my project does using NetworkLobby$$anonymous$$anager).
Hi @Halichoerus!
thank you for understanding that networking as a struggle. It's nice to know someone else out there knows the UNET as well as me and the unity answers ad$$anonymous$$s.
I do get a timeout error. You are right! Does this have to do with the port?
Timeout can mean several things, but in general it just means that the client could not find the server one way or another, and after a while (configurable) of trying to connect, it gets "timed out". So unfortunately it doesn't tell us much, was just curios to see if there were any other exceptions that might have caused the problem.
Anyway, it could be a port conflict, although I don't think so, you can just try a few random ports like 7777 (what I'm using currently) if you want to be sure. If that doesn't work try port-forwarding the port you're using for the game, then connect to your host with your public address.
@Halichoerus I tried the port 55000 also, which should be a private port that cannot be registered. and it didn't work. same thing.
Try port forwarding then, it could be an issue with your LAN, if you don't know how to just google something like "How to port forward my insert ISP here router" and find a guide. Then use your public address ins$$anonymous$$d of your LAN address to connect to your host.
Answer by awplays49 · Oct 20, 2015 at 02:02 PM
So I wanted to follow up.
It was indeed my firewall. Just a matter of figuring out what setting was blocking it. I made a unity exception and now it works. I wouldn't quote myself though, because I'm almost paranoid now that it might reoccur. So I'm going to keep this answer unchecked just to test it some more. Thanks, Aidan.
Your answer
![](https://koobas.hobune.stream/wayback/20220612041656im_/https://answers.unity.com/themes/thub/images/avi.jpg)