Class ChatSendable
An abstract class that represents a sendable object in the chat system. For example a Request or a Response.
public abstract class ChatSendable
- Inheritance
-
ChatSendable
- Derived
- Inherited Members
Properties
Timestamp
Gets or sets the timestamp of the request.
public DateTime Timestamp { get; set; }
Property Value
- DateTime
The timestamp of the request.
Methods
SerializeAndSend(IPEndPoint, UdpClient)
public virtual int SerializeAndSend(IPEndPoint endpoint, UdpClient sender)
Parameters
endpoint
IPEndPointsender
UdpClient
Returns
SerializeAndSend(IPEndPoint, ref UdpClient)
public virtual int SerializeAndSend(IPEndPoint endpoint, ref UdpClient sender)
Parameters
endpoint
IPEndPointsender
UdpClient
Returns
SerializeAndSend(ref IPEndPoint, ref UdpClient)
Serializes the object and sends it to the specified endpoint using the specified client.
public virtual int SerializeAndSend(ref IPEndPoint endpoint, ref UdpClient sender)
Parameters
endpoint
IPEndPointThe endpoint to send this ChatSendable to
sender
UdpClientThe UdpClient sending this ChatSendable
Returns
- int
The numbers of bytes sent
Remarks
This method is virtual so that it can be overridden. The default implementation uses Serialize(object, Type, JsonSerializerOptions). This makes it possible for any class that inherits from ChatSendable to be serialized and sent.