mirror of
https://github.com/chylex/Minecraft-Phantom-Panel.git
synced 2025-08-30 04:53:10 +02:00
.config
.run
.workdir
Agent
Common
Controller
Docker
Utils
Phantom.Utils
Phantom.Utils.Events
Phantom.Utils.Logging
Phantom.Utils.Rpc
Message
Runtime
Sockets
RpcClientSocket.cs
RpcServerSocket.cs
RpcSocket.cs
Phantom.Utils.Rpc.csproj
RpcConfiguration.cs
RpcExtensions.cs
RpcQueue.cs
Phantom.Utils.Tests
Web
.dockerignore
.gitattributes
.gitignore
AddMigration.bat
AddMigration.sh
Directory.Build.props
Directory.Build.targets
Dockerfile
LICENSE
Packages.props
PhantomPanel.sln
README.md
global.json
26 lines
777 B
C#
26 lines
777 B
C#
using NetMQ;
|
|
using Phantom.Utils.Rpc.Message;
|
|
|
|
namespace Phantom.Utils.Rpc.Sockets;
|
|
|
|
static class RpcSocket {
|
|
internal static void SetDefaultSocketOptions(ThreadSafeSocketOptions options) {
|
|
// TODO test behavior when either agent or server are offline for a very long time
|
|
options.DelayAttachOnConnect = true;
|
|
options.ReceiveHighWatermark = 10_000;
|
|
options.SendHighWatermark = 10_000;
|
|
}
|
|
}
|
|
|
|
public abstract class RpcSocket<TSocket> where TSocket : ThreadSafeSocket {
|
|
internal TSocket Socket { get; }
|
|
internal RpcConfiguration Config { get; }
|
|
internal MessageReplyTracker ReplyTracker { get; }
|
|
|
|
protected RpcSocket(TSocket socket, RpcConfiguration config) {
|
|
Socket = socket;
|
|
Config = config;
|
|
ReplyTracker = new MessageReplyTracker(config.LoggerName);
|
|
}
|
|
}
|