Photon and Unity 3D - ExceptionOnConnect Disconnect Message

Options
QuantumCD
edited January 2014 in Photon Server
I've been working on a Photon server that uses Unity 3D as the client. It's an authoritative server using the Server SDK. I'm not using PUN or Cloud.

Recently, I tried sending out a development build to a tester. However, the client cannot connect to the server properly. I'm running a Proxy server off of my development machine with the port 5055 (using UDP) forwarded to the machine's local IP. Whenever I try to connect the client peer, I keep getting disconnected. However, I'm getting a peculiar log entry of "ExceptionOnConnect". What could this mean? I really have no idea how to go about fixing this or even where to start looking to fix it. The firewall settings seem to be in order; I'm able to connect on localhost:5055 just fine.

Any ideas/help would be much appreciated!

Comments

  • I forgot to mention that I'm using Unity 4.3 and the Photon-Server-SDK_v3-2-10-4248 7z file from the SDK downloads page. If it matters at all, I'm using Visual Studio 2012 Ultimate and running this all on Windows 7 x64.
  • Please excuse the late response - we had our office closed down during the holidays.

    Thanks for the detailed information. Your problem is obviously the proxy / port forwarding to your development machine. I can not give a solution "out of the box", but here are some things you should look at:

    First, make sure to enable port forwarding for ports 843 as well (crossdomain policy file) - required by Unity Web Player

    Then: Which application / Photon instance are you using? Are you using the "Default" instance (with the "Lite" application), or the "Loadbalancing" instance?

    If you are using loadbalancing:
    -- set up port forwarding for 5056 + 5057 as well. Here is a complete list of Photon ports: http://doc.exitgames.com/en/photon-server/Requirements
    -- set the Game Server IP: it should be your public IP (start Photon Control -> Game Server IP Config -> "Set public IP" or "Set autodetect public IP")

    You can use a tool like Wireshark to trace if a request actually reaches your server on the assigned port.

    This thread is about a similar issue: viewtopic.php?f=5&t=3445&p=15092

    Please let us know if you find a solution or if you need more help.
  • I have done all those things, and it still isn't working. :(

    As a last resort, I forwarded every port listed on the Photon requirements page and completely disabled my firewalls (temporarily, of course). It still didn't work. Any other ideas? I could really use the ability to host the server on my development machine right now, as I'm easily making 20-30 new builds a day sometimes and having to deal with an external server would be a hassle. Also, those cost money (especially since Photon needs Windows servers) which is seldom available this early on in development.

    Other than that, I'm loving Photon! It's definitely much easier to work with actual client/server interaction and logic when you aren't dealing with the low-level mess that is sockets, etc. :)
  • Hmm... as a quick addition to my previous post, I am not seeing any packets coming back to my development machine at all. O_o

    Looks like they are being eaten somewhere along the way.
  • Hey,

    it's hard to tell without further details, but it alls sounds like this is an issue with your port forwarding.

    Another idea: you could test your port forwarding setup with an "easy" setup without Photon first - for example, start IIS on your dev machine and redirect traffic for port 80 from your external IP to your dev machine. If that is working and you still have trouble with Photon, we can check log files etc. - if it does not work, you need to have a closer look at your network setup.

    I'm sorry, but we can not provide extensive support about custom network setups here :(
  • The odd thing is that I have successfully port forwarded many things in the past, including Apache and custom sockets. Is there anything about the way Photon transmits its UDP packets that could be causing my router to "drop" them? I know that I did have a problem with UDP and that one time when my router was getting a ton of messages a second (10 from each client) and there were about 20 clients connected. I had to mess with custom firmware to allow those packets through. It was a mess. I'm really hoping that isn't the case, but I think I'm going to have to look into that. :/

    What led me to the conclusion of external router problems is that Photon will get messages on the LAN... just not external messages. For example, I built a client and put it on my laptop and it connected to my development machine. So it isn't the firewall causing the issue--I'm fairly certain.

    Please get back to me on the packets if possible. I'd be grateful to know if anyone has ever had problems with routers and possibly ISP's dropping Photon packets altogether, as this is where my suspicions are pointing right now. It just doesn't add up, as one client sending 12-15 packets a second shouldn't be causing this....
  • Hey,

    you can also try to switch to TCP and see if it works better... that should be fine for testing as well. Just note that we are using different ports there.

    It might be an issue with your router (as you already noticed) or even your internet provider - I simply can not tell from here. We have had another customer who had problems with port forwarding and described similar issues as you do - it looked as if packets where dropped either by his router or his internet provider, but I don't know if there had been a solution in the end. So, sorry again - I really can not provide any more help here. :(

    You might get better support on a dedicated forum for hardware / network issues, or you might want to skip this hassle altogether and get a cheap virtual server where you deploy Photon for testing. It might save you lots of headache in the long run. ;)
  • Yeah, I appreciate the help so far though. Does Exit Games recommend any particular type/brand of hosting? Or will most any Windows Server work?