Comments (3)
@yanmasharski Please can you share some of the code you use to manage your socket. Also when you mention that an RPC might be in progress is it an RPC over the socket or client object?
from nakama-unity.
RPC is running over client objet.
socket = client.NewSocket();
try
{
await socket.ConnectAsync(session, true, 30);
}
catch
{
return;
}
socket.Closed += OnSocketClosed;
socket.ReceivedError += OnReceivedException;
And we reconnect the socket after a 2-second delay if it was closed or if we got an exception and the socket is not connected.
For reconnection, we use the following code
var connectTask = socket.ConnectAsync(session);
await connectTask;
var joinChatTask = socket.JoinChatAsync(channelId, channelType, true);
var result = await joinChatTask;
var connectTask = socket.ConnectAsync(session, true, 30);
from nakama-unity.
The issue was solved by closing sockets on an app pause
private void OnApplicationPause(bool p)
{
if (p)
{
socket.CloseAsync();
}
}
from nakama-unity.
Related Issues (20)
- IOS 15 Crash HOT 1
- Could you please provide original C# code for nakama.DLL? HOT 12
- `HttpRequestAdapter` and `WebSocketAdapter` don't connect properly over local network on iOS
- Dont get data of leaderboard HOT 9
- Illegal Byte Sequence during auth when path has chinese characters in it (mono issue) HOT 1
- UnityWebRequestAdapter doesn't write logs to ILogger HOT 1
- Storage write rejected - version check failed HOT 5
- SocketException: mono-io-layer-error (61) on iOS device for AuthenticateDeviceAsync HOT 1
- Imatch Presences is empty HOT 1
- Connect to database HOT 2
- Use database and redis HOT 2
- The document on the official website has not been updated HOT 3
- C# / Unity - [BUG] Client does not get return from server API call HOT 2
- [Ehancement] Open-Source Nakama.dll - Plugins HOT 1
- Doesn't support leaderboard rank counts yet HOT 1
- Trouble with Socket.AddMatchmakerAsync in Nakama HOT 1
- IEnumerable<IApiStorageObject>' does not contain a definition for 'Any' and no accessible extension method 'Any' accepting a first argument of type 'IEnumerable<IApiStorageObject>' could be found (are you missing a using directive or an assembly reference?) HOT 1
- MacOS support ? HOT 4
- Full documentation link is dead HOT 6
- Setup OpenUPM Installation Option. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nakama-unity.