Show / Hide Table of Contents

Class ConnectionRequest

Inheritance
object
LiteConnectionRequest
ConnectionRequest
Inherited Members
LiteConnectionRequest.Data
LiteConnectionRequest.RemoteEndPoint
LiteConnectionRequest.Reject(byte[], int, int, bool)
LiteConnectionRequest.Reject(byte[], int, int)
LiteConnectionRequest.RejectForce(byte[], int, int)
LiteConnectionRequest.RejectForce()
LiteConnectionRequest.RejectForce(byte[])
LiteConnectionRequest.RejectForce(NetDataWriter)
LiteConnectionRequest.Reject()
LiteConnectionRequest.Reject(byte[])
LiteConnectionRequest.Reject(NetDataWriter)
Namespace: LiteNetLib
Assembly: LiteNetLib.dll
Syntax
public class ConnectionRequest : LiteConnectionRequest

Methods

Accept()

Accept connection and get new NetPeer as result

Declaration
public NetPeer Accept()
Returns
Type Description
NetPeer

Connected NetPeer

AcceptIfKey(string)

Accepts the connection if the first string in the Data matches the provided key.

Declaration
public NetPeer AcceptIfKey(string key)
Parameters
Type Name Description
string key

The required string key to match.

Returns
Type Description
NetPeer

A new LiteNetPeer if the key matches and connection is accepted; otherwise, null.

Remarks

This is a helper method for simple password/key validation. If the key does not match or data is invalid, the connection is automatically rejected.

In this article
Back to top Generated by DocFX