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.