Class ConnectionRequest
A connection request received by an active host.
Inheritance
Namespace: SuperNet.Netcode.Transport
Assembly: cs.temp.dll.dll
Syntax
public class ConnectionRequest : IDisposable
Fields
Host
The host that received this request.
Declaration
public readonly Host Host
Field Value
| Type | Description |
|---|---|
| Host |
Remote
Remote address that the request was received from.
Declaration
public readonly IPEndPoint Remote
Field Value
| Type | Description |
|---|---|
| IPEndPoint |
Properties
Accepted
True if the request has been accepted.
Declaration
public bool Accepted { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Authenticate
True if remote peer requires us to authenticate.
Declaration
public bool Authenticate { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Disposed
True if the underlying buffers for the request have been repurposed for something else.
Declaration
public bool Disposed { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Encrypted
True if remote peer requires encryption.
Declaration
public bool Encrypted { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Peer
Peer accepted or null if none.
Declaration
public Peer Peer { get; }
Property Value
| Type | Description |
|---|---|
| Peer |
Rejected
True if the request has been rejected.
Declaration
public bool Rejected { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Methods
Accept(PeerConfig, IPeerListener)
Accept the request, create a new peer and establish a connection.
Declaration
public Peer Accept(PeerConfig config = null, IPeerListener listener = null)
Parameters
| Type | Name | Description |
|---|---|---|
| PeerConfig | config | Peer configuration values. If null, default is used. |
| IPeerListener | listener | Peer listener. If null, event based listener is created. |
Returns
| Type | Description |
|---|---|
| Peer | The created peer. |
Dispose()
Used internally by the netcode to invalidate the request, making it unable to be accepted.
This is called when the underlying buffers have been repurposed for something else.
Declaration
public void Dispose()
Reject(IWritable)
Reject the request by sending a reject message.
Declaration
public void Reject(IWritable message = null)
Parameters
| Type | Name | Description |
|---|---|---|
| IWritable | message | Message to reject with. |