Table of Contents

Class SocketMessageLayer

Namespace
Stride.Engine.Network
Assembly
Stride.Engine.dll

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 SimpleSocket
isServer bool

Properties

Context

public SimpleSocket Context { get; }

Property Value

SimpleSocket

Methods

AddPacketHandler<T>(Action<T>, bool)

public void AddPacketHandler<T>(Action<T> handler, bool oneTime = false)

Parameters

handler Action<T>
oneTime bool

Type Parameters

T

AddPacketHandler<T>(Func<T, Task>, bool)

public void AddPacketHandler<T>(Func<T, Task> asyncHandler, bool oneTime = false)

Parameters

asyncHandler Func<T, Task>
oneTime bool

Type Parameters

T

MessageLoop()

public Task MessageLoop()

Returns

Task

Send(object)

public Task Send(object obj)

Parameters

obj object

Returns

Task

SendReceiveAsync(SocketMessage)

public Task<SocketMessage> SendReceiveAsync(SocketMessage query)

Parameters

query SocketMessage

Returns

Task<SocketMessage>