Photon public connection error

Hello!

I am using the Photon Control panel (Self Hosted). This works with 127.0.0.1
But i have portforwarded my public ip and the port 5055 on TCP and UDP.

i have it setup like this:



But everytime i try to connect it gives me :

Receive issue. State: Connected. Server: '********' Exception: System.Net.Sockets.SocketException: The external host closed the connection.


My photon control is also running on my public ip...

Thanks for any help!!

Comments

  • Hi,

    I have moved this message to the PhotonServer, you'll have more chance to get useful information and tips there.

    Bye,

    Jean
  • well, exception you see means that you can not connect to selected host. but there is to many reasons why this could happene. starting from wrong settings and ending with firewall settings. Even way how you setup connection may lead to error.
    how do you connect to your server? from what machine? how this machine are related to server machine?
  • Luckie12
    Luckie12
    edited November 2016
    So, i try to connect using my public ip, i host it on my pc where the public ip is running on + port is opened on. i asked a friend from UK to connect but he said that photon kept hanging on PeerCreated. So

    This is my lobby script

    public GameObject playerPrefab;

    void Start()
    {
    PhotonNetwork.ConnectUsingSettings("V2.0.1");
    }

    private const string roomName = "RoomName";
    private RoomInfo[] roomsList;

    void OnGUI()
    {
    if (!PhotonNetwork.connected)
    {
    GUILayout.Label(PhotonNetwork.connectionStateDetailed.ToString());
    }
    else if (PhotonNetwork.room == null)
    {

    if (PhotonNetwork.countOfRooms >= 1)
    {
    Debug.Log("Not possible to make another one!");
    }
    else
    {
    // Create Room
    if (GUI.Button(new Rect(100, 100, 250, 100), "Start Server"))
    {
    RoomOptions roomOptions = new RoomOptions() { IsVisible = true, MaxPlayers = 16 };
    PhotonNetwork.CreateRoom(roomName + Guid.NewGuid().ToString("N"), roomOptions, TypedLobby.Default);
    }
    }
    // Join Room
    if (roomsList != null)
    {
    for (int i = 0; i < roomsList.Length; i++)
    {
    if (GUI.Button(new Rect(100, 250 + (110 * i), 250, 100), "Join " + roomsList[i].name))
    PhotonNetwork.JoinRoom(roomsList[i].name);
    }
    }
    }
    }

    void OnReceivedRoomListUpdate()
    {
    roomsList = PhotonNetwork.GetRoomList();
    }
    void OnJoinedRoom()
    {
    PhotonNetwork.LoadLevel(1);
    Debug.Log("Connected to Room");
    //PhotonNetwork.Instantiate(playerPrefab.name, Vector3.up * 5, Quaternion.identity, 0);
    }
  • is public ip on your machine or on router?
  • The public ip is from me, because i am hosting it... its portforwarded on my router.
  • do you see your public ip address if you type 'ipconfig' in console?
  • No, + everything else like other game servers work on my public ip
  • >No, + everything else like other game servers work on my public ip
    this means that your ip address attached to your router. so you should setup it carefully in order to get it working. Please check that all ports, IPs and protocols are set correctly. there is no need in special magic from photon side. just make sure that it listens ip adress need. i mean hear not your public ip, but your machine adress. it is usualy 192.168.x.x. if you use 0.0.0.0 to setup listeners in photonserver.config, then there is no need for extra actions.
    only check what your router does
  • chvetsov said:

    >No, + everything else like other game servers work on my public ip
    this means that your ip address attached to your router. so you should setup it carefully in order to get it working. Please check that all ports, IPs and protocols are set correctly. there is no need in special magic from photon side. just make sure that it listens ip adress need. i mean hear not your public ip, but your machine adress. it is usualy 192.168.x.x. if you use 0.0.0.0 to setup listeners in photonserver.config, then there is no need for extra actions.
    only check what your router does

    1. Could you elaborate on that please? What do you mean by "all ports, IPs, protocols are set-up correctly"?
    2. How do I make sure Photon listens to the correct IP?
    3. How can I check what my router is doing?
  • well, i tried to setup photon at home.
    i left default configuaration settings for ports and ips in PhotonServer.config.
    for ips default is '0.0.0.0' so it listens all accessible ips
    on my router i've setup port forwarding from outer network to internal. i can not say how to setup your roter. find this in router docs or use search engine. I did not managed to get right from first time. i tried few times and eventually got it working. that is why i said, that you need carefully setup your router

    3. i do not know