SocketMessageLayer Class
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.
System.Object →
SocketMessageLayer
Derived from SocketMessageLayer:
public class SocketMessageLayer
|
Improve this Doc
View Source
Constructors
SocketMessageLayer(SimpleSocket, Boolean)
public SocketMessageLayer(SimpleSocket context, bool isServer)
Parameters
Type |
Name |
Description |
SimpleSocket |
context |
|
System.Boolean |
isServer |
|
|
Improve this Doc
View Source
Properties
Context
public SimpleSocket Context { get; }
Property Value
|
Improve this Doc
View Source
Methods
AddPacketHandler<T>(Action<T>, Boolean)
public void AddPacketHandler<T>(Action<T> handler, bool oneTime = false)
Parameters
Type |
Name |
Description |
System.Action<T> |
handler |
|
System.Boolean |
oneTime |
|
Type Parameters
AddPacketHandler<T>(Func<T, Task>, Boolean)
public void AddPacketHandler<T>(Func<T, Task> asyncHandler, bool oneTime = false)
Parameters
Type |
Name |
Description |
System.Func<T, System.Threading.Tasks.Task> |
asyncHandler |
|
System.Boolean |
oneTime |
|
Type Parameters
MessageLoop()
public async Task MessageLoop()
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
Send(Object)
public async Task Send(object obj)
Parameters
Type |
Name |
Description |
System.Object |
obj |
|
Returns
Type |
Description |
System.Threading.Tasks.Task |
|
SendReceiveAsync(SocketMessage)
public async Task<SocketMessage> SendReceiveAsync(SocketMessage query)
Parameters
Returns
Extension Methods