0

I am using this library for networking my game, and it works great on localhost; but I put my server.exe listener on my AWS EC2 windows remote instance, and I have not been able to connect to it.

These are all the things I have done to try and get it to work:

  • Added AWS security group rules for my ports (I eventually tried enabling all traffic/addresses/ports), for inbound/outbound connections
  • disabled firewall on my local computer and on remote ec2 instance
  • set the server on the remote ec2 instance to listen for 0.0.0.0:3813
  • set client to connect to my aws elastic ip which is associated with my ec2 instance, on port 3813
  • ran netstat on ec2 instance and verified it was listening for 0.0.0.0:3813
  • pinged my ec2 instance elastic ip to see if I was able to get through to it
  • double(triple) checked all of the above

It seems many people facing the same issue as me have resolved it by adding the essential security group rules, but that has not fixed it for me. I have a feeling that the library I am using might have some weird security thing might be messing with my IP's or something (just a thought). I have tried looking as to what it does with the CreateServer function and it seems like it should be working. Also, I noticed it uses System.Net.Sockets. If anybody has any ideas what I might be doing wrong please help!

Edit:

Here is error I just noticed:

FormatException: An invalid IP address was specified.
System.Net.IPAddress.Parse (System.String ipString)
clientTest+<connectToServer>c__Iterator0.MoveNext () (at Assets/Networking/Scripts/Core/clientTest.cs:71)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at C:/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
clientTest:<Start>m__1(NetcodeClient) (at Assets/Networking/Scripts/Core/clientTest.cs:50)
UnityNetcodeIO.UnityNetcode:CreateClient(NetcodeIOClientProtocol, Action`1) (at Assets/Networking/Scripts/Core/UnityNetcode.cs:205)
clientTest:<Start>m__0(NetcodeIOSupportStatus) (at Assets/Networking/Scripts/Core/clientTest.cs:47)
UnityNetcodeIO.UnityNetcode:QuerySupport(Action`1) (at Assets/Networking/Scripts/Core/UnityNetcode.cs:144)
clientTest:Start() (at Assets/Networking/Scripts/Core/clientTest.cs:41)

Edit2: I did not make any changes, and somehow this error is not showing up anymore. I am just getting a timeout now.

  • It looks like you need to debug your code. – Michael Hampton Jul 23 '18 at 21:30
  • Do you have any ideas as to why an error like that would popup, and then not be reproducible? I am not getting it anymore and made no changes to code. I was kinda hoping that error would lead me to the source of my problems, but sadly it does not seem to be the issue :(. – Bureto Jul 23 '18 at 22:58
  • It's hard to tell from an ops perspective. I still think you need to debug your code. – Michael Hampton Jul 23 '18 at 23:02
  • Okay so after a lot of debugging, I am pretty sure the code should be working. Like I haven't seen anything that would sugggest blocking my connection. Now I am going against my first impression, I think my ec2 instance might be blocking it or some other external thing. I am totally stumped, and I can honestly say that this has been more a pain than it is probably worth. I would like to setup using another library but I wouldn't want to switch over to get right back into the same position. Is there any other thing that might be blocking the connection? – Bureto Jul 24 '18 at 2:41
  • I don't fully understand how the connect token works but the rest is pretty easy to understand. My script on the client directly calls this connect function after getting the connect token. Its not that big a read if you wanna take a look. IDK though, I also looked through the server portion yesterday and it looked okay; so I think it must either have to do with the connect token or an issue with another external conflict (e.g firewall) though not firewall since I disabled it. – Bureto Jul 24 '18 at 2:47

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.