Connection Refused: Socket Exception

Options
I am having trouble setting up PUN. All of the demos give the same error but I don't understand what the problem is and can't find a fix online.

The error I get when trying to connect is:
Receive issue. State: Connected Exception: System.Net.Sockets.SocketException: Connection refused
at System.Net.Sockets.Socket.Receive (System.Byte[] buffer) [0x00000] in <filename unknown>:0
at ExitGames.Client.Photon.SocketUdp.ReceiveLoop () [0x00000] in <filename unknown>:0
UnityEngine.Debug:LogError(Object)
PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:153)
NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:934)
ExitGames.Client.Photon.<>c__DisplayClass2:<EnqueueDebugReturn>b__0()
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:76)


My scene is simple. This is the line trying to connect:

PhotonNetwork.ConnectUsingSettings ("v0.1");

I'm on Mac using Unity 4.3.2f1, with a Unity Pro license. I've disabled my firewall. Any help in understanding this (frustrating) situation would be greatly appreciated.

Comments

  • Tobias
    Options
    Maybe your PhotonServerSettings are badly configured and ConnectUsingSettings tries to connect to a local server (which you don't run).
    You can run the Wizard again. In the first window press "Setup" and configure your Photon Cloud settings.
  • Tobias
    Options
    And: On OSX, I am not entirely sure but if I remember correctly, there might be a bug with export. Try the 32bit builds!
    If that helps, I am not sure if Unity is aware of that issue. Maybe you report it as bug or test in 4.5.2p1 and report.
  • Has this ever been resolved? I'm getting the same problem. I can connect fine. I get this error ("Connection refused") when I create a game with PhotonNetwork.CreateRoom().

    I'm running a server in LAN. If I run my game on the server (Windows 10), it creates the room fine. However if I use a different machine as a client, I get the error.
    I'm using Unity 5.4.1 and 5.4.2 on OSX. I tried using both 32 bit and 64 bit PhotonControl on server. I also turned off Firewall on both the server and client.
  • I found the solution. In PhotonControl, the IP address of the server defaults to 127.0.0.1. If I set it to it's Local IP (192.168.x.x), it works.