public SyncIOServer(TransportProtocal _protocal, Packager _packager) { Protocal = _protocal; Packager = _packager; Callbacks = new CallbackManager <SyncIOConnectedClient>(); Clients = new ClientManager(); RemoteFuncs = new RemoteCallServerManager(Packager); SetHandler <RemoteCallRequest>((cl, att) => RemoteFuncs.HandleClientFunctionCall(cl, att)); }
public SyncIOClient(TransportProtocal _protocal, Packager _packager) { Protocal = _protocal; Packager = _packager; Callbacks = new CallbackManager <SyncIOClient>(); RemoteFunctions = new RemoteFunctionManager(); Callbacks.SetHandler <HandshakePacket>((c, p) => { HandshakeComplete = p.Success; Connection.SetID(p.ID); HandshakeEvent?.Set(); HandshakeEvent?.Dispose(); HandshakeEvent = null; OnHandshake?.Invoke(this, ID, HandshakeComplete); Callbacks.RemoveHandler <HandshakePacket>(); }); Callbacks.SetHandler <RemoteCallResponse>((c, p) => { RemoteFunctions.RaiseFunction(p); }); }
public BaseServerSocket(TransportProtocal _protocal) { Protocal = _protocal; InternalAcceptHandler = new AsyncCallback(HandleAccept); }
public ServerUDPSocket(TransportProtocal _protocal, Action <byte[]> callback) { Protocal = _protocal; UdpDataReceved = callback; }