How to handle the error "UNet Client Disconnect Error: Timeout"? - unity3d

How to handle the error "UNet Client Disconnect Error: Timeout"? How not reboot the application, when it occurs?

I now resolve this issue.
I think this can help you too.
myClient.RegisterHandler(MsgType.Error, OnError);
void OnError(NetworkMessage msg){
//Error handler code
}
This Error client receive with "UNET Client Disconnect Error: Timeout".
My solution: If i not have server. I set current client as Server.

Related

Flutter webrtc Failed to set remote answer sdp

I am trying to connect two peer in flutter webrtc but i am getting below error.I am using firebase as a signalling server.
[ERROR:flutter/lib/ui/ui_dart_state.cc(177)] Unhandled Exception: Unable to RTCPeerConnection::setRemoteDescription: peerConnectionSetRemoteDescription(): WEBRTC_SET_REMOTE_DESCRIPTION_ERROR: Failed to set remote answer sdp: Called in wrong state: stable
I am using below code in listening to the changes in firebase
if (val['t'] == "ans") {
assert(isInitiator);
_peerCon.setRemoteDescription(
RTCSessionDescription(
val['sdp'],
val['tp'],
),
);
return;
}
One peer connection can only set one remote description.
You are trying to setRemoteDescription on a peer with an already established connection. That's why you getting this error.
Check this thread for more details:
Failed to set remote answer sdp: Called in wrong state: stable

System.IO.IOException: Unable to read data from the transport connection

Using IIS, ASP.NET Core 2.2 and RestSharp V106.6.10 via Nuget on multiple servers getting exceptions after a period of time. My API calls with RestSharp work for a while then all of a sudden they start failing with common exception messages such as...
"ErrorException:System.Net.WebException: An error occurred while sending the request. Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.IO.IOException: Unable to read data from the transport connection: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond"
This occurs on multiple servers and I have yet to determine the source of the issue.
I have tried to create RestClient per call and also as a singleton with the same exception in both cases. I have also tried using syncrhonously as well as async all the way from the controller to the server call. In all cases I continue to get the above failure messages after a period of time.
Restarting the apppool does not resolve the issue. The only thing that will resolve this is a server reboot. I believe it has something to do with http client connections and reaching some limit but have yet to determine why i continue to have this issue.
Any help would be greatly appreciated. (Reference also https://github.com/restsharp/RestSharp/issues/1322)
Code currently looks like...
var defaultTimeout = 5 * 60 * 1000;
_restClientTimeout = defaultTimeout;
_restClientReadWriteTimeout = defaultTimeout;
_requestTimeout = defaultTimeout;
_client = new RestClient(_fastFieldBaseUrl);
_client.Timeout = _restClientTimeout;
_client.ReadWriteTimeout = _restClientReadWriteTimeout;
var request = new RestRequest(url, Method.POST);
request.Timeout = _requestTimeout;
request.ReadWriteTimeout = _requestTimeout;
request.AddHeader("Content-Type", "application/json");
request.AddParameter("body", json, ParameterType.RequestBody);
try
{
var response = await _client.ExecuteTaskAsync(request);
if (response.StatusCode == HttpStatusCode.Created)
{
return response.RawBytes;
}
else
{
var message= $"ExecuteTaskAsync raw bytes is null GetResponseMessage(response)}";
Log(message, traceIdentifier, null, Microsoft.Extensions.Logging.LogLevel.Error);
return null;
}
}
catch (Exception e)
{
var message = $"Error: {e.ToString()}";
Log(message, traceIdentifier, e, Microsoft.Extensions.Logging.LogLevel.Error);
}

Decoding halted because of invalid data in the stream

I am using Workstation.UaClient 2.0
when i try to connect to
opc.tcp://My-PC:53530/OPCUA/SimulationServer
i am able to successfully connect to prosys OPC UA simulation server.
But when i try to create subscription,
In this line
BrowseResponse browseResponse = await channel.BrowseAsync(browseRequest);
it throw exception
Decoding halted because of invalid data in the stream.
Same code works with kepserver.
Please help to fix this issue.

Why is Swift Kitura Server Not Terminating Some Threads?

I am having a somewhat reproducible problem on a Swift server I'm running. This is a multi-threaded server, using Kitura. The basics are: After the server has been running for a period of time, download requests start needing retries from the client (usually three retries). The attempts from the client result in the server thread not terminating. On the server, the download problem shows up like this in the log:
[INFO] REQUEST /DownloadFile: ABOUT TO END ...
And then the request never terminates.
The relevant fragment code in my server looks like this:
// <snip>
Log.info(message: "REQUEST \(request.urlURL.path): ABOUT TO END ...")
do {
try self.response.end()
Log.info(message: "REQUEST \(request.urlURL.path): STATUS CODE: \(response.statusCode)")
} catch (let error) {
Log.error(message: "Failed on `end` in failWithError: \(error.localizedDescription); HTTP status code: \(response.statusCode)")
}
Log.info(message: "REQUEST \(request.urlURL.path): COMPLETED")
// <snip>
That is, the server clearly seems to hang on the call to end (a Kitura method). See also https://github.com/crspybits/SyncServerII/blob/master/Sources/Server/Setup/RequestHandler.swift#L105
Immediately before this issue came up last time, I observed the following in my server log:
[2017-07-12T15:31:23.302Z] [ERROR] [HTTPServer.swift:194 listen(listenSocket:socketManager:)] Error accepting client connection: Error code: 5(0x5), ERROR: SSL_accept, code: 5, reason: DH lib
[2017-07-12T15:31:23.604Z] [ERROR] [HTTPServer.swift:194 listen(listenSocket:socketManager:)] Error accepting client connection: Error code: 1(0x1), ERROR: SSL_accept, code: 1, reason: Could not determine error reason.
[2017-07-12T15:31:23.995Z] [ERROR] [HTTPServer.swift:194 listen(listenSocket:socketManager:)] Error accepting client connection: Error code: 1(0x1), ERROR: SSL_accept, code: 1, reason: Could not determine error reason.
[2017-07-12T15:40:32.941Z] [ERROR] [HTTPServer.swift:194 listen(listenSocket:socketManager:)] Error accepting client connection: Error code: 1(0x1), ERROR: SSL_accept, code: 1, reason: Could not determine error reason.
[2017-07-12T15:42:43.000Z] [VERBOSE] [HTTPServerRequest.swift:215 parsingCompleted()] HTTP request from=139.162.78.135; proto=https;
[INFO] REQUEST RECEIVED: /
[2017-07-12T16:32:38.479Z] [ERROR] [HTTPServer.swift:194 listen(listenSocket:socketManager:)] Error accepting client connection: Error code: 1(0x1), ERROR: SSL_accept, code: 1, reason: Could not determine error reason.
I am not sure where this is coming from in the sense that I'm not sure if one of my client's is generating this. I do not explicitly make requests to my server with "/". (I do occasionally see requests made to my server from clients that are not mine-- it is possible this is one of these). Note that all except one of these log messages are coming from Kitura, not directly from my code. My log message is [INFO] REQUEST RECEIVED: /.
If I was a betting man, I'd say the above errors put my server into a state where afterwards, I see this download/retry behavior.
My only solution at this point is to restart the server. From which point the issue doesn't immediately happen.
Thoughts?
I'm not sure if this addresses the root problem, or if it's just a work-around, but it appears to be working. With the server as stated in the question, I had been using Kitura's built-in SSL support. I have now switched to using NGINX as a front-end, and no longer use Kitura's built-in SSL support. NGINX takes care of all the HTTPS/SSL details. Since doing this (about a month ago), and with the server running for all of that intervening time, I have not experience the not terminating issue reported in this question. See also https://github.com/crspybits/SyncServerII/issues/28

IWAB0135E An unexpected error has occurred

I have this error when I'm trying to invoke an operation of my web service. I'm using Eclipse and the web service is a simple "Say hello" one. Here's the entire error :
IWAB0135E An unexpected error has occurred.
java.net.ConnectException
Connection timed out: connect
Does anyone know how I could fix that ? Thank you in advance
It says "java.net.ConnectException Connection timed out: connect". Make sure that your end points are correct and service is listening properly.