Author Topic: error on Broadcast in Unity Editor  (Read 5099 times)

phoenix

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 49
    • View Profile
error on Broadcast in Unity Editor
« on: August 13, 2014, 03:56:22 PM »
I am getting this error on the new version of TNET in the unity editor

It is working on ios and android and on another programmers computer.

I have turned off the firewall and I have no idea why this is crashing/not working?

TNet.UnityTools:Broadcast(String, Object[]) (at Assets/TNet/Client/TNUnityTools.cs:206)
TNManager:OnConnect(Boolean, String) (at Assets/TNet/Client/TNManager.cs:1143)
TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:752)
TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:720)
TNManager:Update() (at Assets/TNet/Client/TNManager.cs:1128)

phoenix

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 49
    • View Profile
Re: error on Broadcast in Unity Editor
« Reply #1 on: August 13, 2014, 05:46:09 PM »
This is working on my PC but I am getting this error on my mac laptop or mac mini.

It looks like it is because I am trying to use a UDP port?

« Last Edit: August 13, 2014, 06:36:07 PM by phoenix »

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: error on Broadcast in Unity Editor
« Reply #2 on: August 14, 2014, 08:26:43 AM »
Line 206 is:
  1. Debug.LogError(ex.InnerException.Message + " (" + mb.GetType() + "." + methodName + ")", mb);
...for me. What's the actual full message, not just the call stack? You never actually posted it...

phoenix

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 3
  • Posts: 49
    • View Profile
Re: error on Broadcast in Unity Editor
« Reply #3 on: August 14, 2014, 08:20:39 PM »
This is the full exception

Exception has been thrown by the target of an invocation. (Lobby.OnNetworkConnect)
UnityEngine.Debug:LogError(Object, Object)
TNet.UnityTools:Broadcast(String, Object[]) (at Assets/TNet/Client/TNUnityTools.cs:206)
TNManager:OnConnect(Boolean, String) (at Assets/TNet/Client/TNManager.cs:1143)
TNet.GameClient:ProcessPacket(Buffer, IPEndPoint) (at Assets/TNet/Client/TNGameClient.cs:752)
TNet.GameClient:ProcessPackets() (at Assets/TNet/Client/TNGameClient.cs:720)
TNManager:Update() (at Assets/TNet/Client/TNManager.cs:1128)


I have narrowed this bug down to UDP, if I use TCP everything works.

Also, it seems to be specific to my macs, something on the mac blocking the UDP???
I turn off the firewall.

I run

ipfw -f add allow udp from any MYPORT to any 1024-65535 in keep-state setup

I dont know what to do? How to trouble shoot this?

This my netstat for udp
udp:
   116510 datagrams received
      0 with incomplete header
      0 with bad data length field
      0 with bad checksum
      0 with no checksum
      54766 checksummed in software
         52934 datagrams (7261482 bytes) over IPv4
         1832 datagrams (373398 bytes) over IPv6
      270 dropped due to no socket
      56063 broadcast/multicast datagrams undelivered
      0 times multicast source filter matched
      10763 dropped due to full socket buffers
      0 not for hashed pcb
      49414 delivered
   92640 datagrams output
      61516 checksummed in software
         58906 datagrams (1839034 bytes) over IPv4
         2610 datagrams (311232 bytes) over IPv6

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: error on Broadcast in Unity Editor
« Reply #4 on: August 15, 2014, 08:16:49 AM »
Quote
Exception has been thrown by the target of an invocation. (Lobby.OnNetworkConnect)
This points at an exception happening inside your Lobby's OnNetworkConnect function. This is your script, not TNet's. Track down which line it's on and you will find your issue. You're likely missing some null check.