Author Topic: Mac and iOS Can't Connect  (Read 4608 times)

SketchWork

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 44
    • View Profile
Mac and iOS Can't Connect
« on: May 23, 2013, 06:46:21 PM »
Hi Michael,

I have a successful build running fine on PC (other than the issues in the other topic:  http://www.tasharen.com/forum/index.php?topic=4366.0)

I can create a local server and connect to it and send and receive everything fine.

Likewise, I can create a stand alone server and connect, send and receive fine.

My issue is with the same code running on Mac or iOS (iPad).  Everything compiles perfectly but when I try to connect to the PC Server (either to local or standalone server) it either connects and immediately disconnects or I get a message saying:  ERROR: An existing connection was forcibly closed by the remote host.  Followed by a Timed out message and then an immediate disconnect.

What do you think is the problem here as everything runs fine on PC 2 PC.

Many thanks, Justin.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Mac and iOS Can't Connect
« Reply #1 on: May 23, 2013, 08:47:06 PM »
Connect followed by a disconnect can only happen if the server version is different from the client, but you should also get an error message telling you this.

What do you see printed in the console window of the server?

SketchWork

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: Mac and iOS Can't Connect
« Reply #2 on: May 24, 2013, 06:58:42 AM »
I have recompiled the server with the same TNet source as the app is using and I still get the same issues.  Everything works perfectly on PC's, but simply doesn't want to work on MAC or iOS.  Even starting the local server on the Mac or iOS doesn't work.

This is the output:

  1. IP Addresses
  2. ------------
  3. External: XXX.XXX.XXX.XXX
  4. Internal: 192.168.1.70
  5. Gateway:  192.168.1.254
  6.  
  7. UDP Lobby Server started on port 5129
  8. Game server started on port 5127
  9. Press 'q' followed by ENTER when you want to quit.
  10. UPnP: UDP port 5129 was opened successfully.
  11. UPnP: TCP port 5127 was opened successfully.
  12. UPnP: UDP port 5128 was opened successfully.
  13. 192.168.1.83:49828 has connected
  14. 192.168.1.83:49828 has disconnected

It disconnects immediately and the Unity editor gives the failure message as "The object was used after being disposed".

Any further connection tries gives this output with the same unity failure message.

  1. IP Addresses
  2. ------------
  3. External: XXX.XXX.XXX.XXX
  4. Internal: 192.168.1.70
  5. Gateway:  192.168.1.254
  6.  
  7. UDP Lobby Server started on port 5129
  8. Game server started on port 5127
  9. Press 'q' followed by ENTER when you want to quit.
  10. UPnP: UDP port 5129 was opened successfully.
  11. UPnP: TCP port 5127 was opened successfully.
  12. UPnP: UDP port 5128 was opened successfully.
  13. 192.168.1.83:49828 has connected (first attempted connection immidiately disconnects)
  14. 192.168.1.83:49828 has disconnected
  15. 192.168.1.83:49833 has connected (further connections give these connection messages)
  16. 192.168.1.83:49833 ERROR: An existing connection was forcibly closed by the remote host
  17. 192.168.1.83:49833 has timed out
  18. 192.168.1.83:49833 has disconnected (with an immediate disconnection)

Everything works as I expect on PC.  Is there anything special I am supposed to be doing for Mac or iOS? 

It also does exactly the same using your included example menu application.

Help :)
« Last Edit: May 24, 2013, 07:06:30 AM by SketchWork »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Mac and iOS Can't Connect
« Reply #3 on: May 24, 2013, 04:15:42 PM »
No, there is nothing that needs to be done differently. I've ran the server from within the game on every platform -- pc, mac, linux, android, and ios without issues, so the issue you are experiencing is new to me. What is your version of OSX?

SketchWork

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: Mac and iOS Can't Connect
« Reply #4 on: May 24, 2013, 04:20:28 PM »
Running 10.8.3 of OSX.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Mac and iOS Can't Connect
« Reply #5 on: May 24, 2013, 04:31:19 PM »
Add me on skype -- arenmook. Sounds like you have some really weird issues!

SketchWork

  • Newbie
  • *
  • Thank You
  • -Given: 1
  • -Receive: 0
  • Posts: 44
    • View Profile
Re: Mac and iOS Can't Connect
« Reply #6 on: May 28, 2013, 11:14:40 AM »
Hi Michael,

I have seemed to have sorted this issue out.  The problem was with the Unity Player settings.  Once I set the Stripping level to disabled and the script call optimisation to slow and safe it started working.

If you debug within xCode it does still throw exceptions on the connect, but the app still works.

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Mac and iOS Can't Connect
« Reply #7 on: May 28, 2013, 02:40:57 PM »
Ah, stripping... the bane of all existence. That option should be removed from Unity. It never does anything right.