Rocher0724 / socket.io-unity

MIT License
107 stars 19 forks source link

Unable to establish connection #22

Open KartikJoshiUK opened 1 year ago

KartikJoshiUK commented 1 year ago

The remote server returned an error: (400) Bad Request. Got this error in visual studio. I got this error even though I am using the same code at the same network in the same machine and the server is working properly as its connects with postman and sanity.io-client easily. This is the whole error I got at line 278 in

\Plugins\Socket\Quobject\EngineIoClientDotNet\Client\Transports\PollingXHR.cs

Line was like this =>

using (WebResponse response = this.Xhr.GetResponse())

Full Error

System.Net.WebException: The remote server returned an error: (400) Bad Request. at System.Net.HttpWebRequest.GetResponseFromData (System.Net.WebResponseStream stream, System.Threading.CancellationToken cancellationToken) [0x00146] in :0 at System.Net.HttpWebRequest.RunWithTimeoutWorker[T] (System.Threading.Tasks.Task`1[TResult] workerTask, System.Int32 timeout, System.Action abort, System.Func`1[TResult] aborted, System.Threading.CancellationTokenSource cts) [0x000f8] in :0 at System.Net.HttpWebRequest.GetResponse () [0x00016] in :0 at Socket.Quobject.EngineIoClientDotNet.Client.Transports.PollingXHR+XHRRequest+<>c__DisplayClass7_0.b__0 () [0x00023] in D:\Projects\Trilon App\Assets\Plugins\Socket\Quobject\EngineIoClientDotNet\Client\Transports\PollingXHR.cs:278 at Socket.Quobject.EngineIoClientDotNet.Thread.EasyTimer.DoWork (System.Object obj) [0x00012] in D:\Projects\Trilon App\Assets\Plugins\Socket\Quobject\EngineIoClientDotNet\Thread\EasyTimer.cs:25 at Socket.Quobject.EngineIoClientDotNet.Thread.EasyTimer+<>c__DisplayClass7_0.b__0 (System.Object arg) [0x00001] in D:\Projects\Trilon App\Assets\Plugins\Socket\Quobject\EngineIoClientDotNet\Thread\EasyTimer.cs:45 at System.Threading.QueueUserWorkItemCallback.WaitCallback_Context (System.Object state) [0x00007] in <1c8569827291471e9db0dcd976e97952>:0 at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00071] in <1c8569827291471e9db0dcd976e97952>:0 at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <1c8569827291471e9db0dcd976e97952>:0 at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem () [0x00021] in <1c8569827291471e9db0dcd976e97952>:0 at System.Threading.ThreadPoolWorkQueue.Dispatch () [0x00074] in <1c8569827291471e9db0dcd976e97952>:0 at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback () [0x00000] in <1c8569827291471e9db0dcd976e97952>:0