Class SocketMessageLayer
High-level layer that can be used on top of SimpleSocket to send and receive objects using serialization.
public class SocketMessageLayer
- Inheritance
-
SocketMessageLayer
Constructors
SocketMessageLayer(SimpleSocket, bool)
public SocketMessageLayer(SimpleSocket context, bool isServer)
Parameters
context
SimpleSocketisServer
bool
Properties
Context
public SimpleSocket Context { get; }
Property Value
Methods
AddPacketHandler<T>(Action<T>, bool)
public void AddPacketHandler<T>(Action<T> handler, bool oneTime = false)
Parameters
Type Parameters
T
AddPacketHandler<T>(Func<T, Task>, bool)
public void AddPacketHandler<T>(Func<T, Task> asyncHandler, bool oneTime = false)
Parameters
Type Parameters
T
MessageLoop()
public Task MessageLoop()
Returns
Send(object)
public Task Send(object obj)
Parameters
obj
object
Returns
SendReceiveAsync(SocketMessage)
public Task<SocketMessage> SendReceiveAsync(SocketMessage query)
Parameters
query
SocketMessage