You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Zero/ZeroLevel/Services/Network/Services/ZExSocketObservableServer.cs

30 lines
769 B

using System;
using System.Net;
namespace ZeroLevel.Network
{
public class ZExSocketObservableServer :
ZSocketServer, IZObservableServer
{
public ZExSocketObservableServer(IPEndPoint endpoint)
: base(endpoint)
{
}
public IPEndPoint Endpoint => base.LocalEndpoint;
public event Action<Frame, IZBackward> OnMessage = (_, __) => { };
public event Func<Frame, IZBackward, Frame> OnRequest = (_, __) => null;
protected override void Handle(Frame frame, IZBackward client)
{
OnMessage(frame, client);
}
protected override Frame HandleRequest(Frame frame, IZBackward client)
{
return OnRequest(frame, client);
}
}
}

Powered by TurnKey Linux.