Table of Contents

Interface INetConnection

Namespace
BSGameLib.Networking
Assembly
BSGameLib.Networking.dll

A connection to a peer: a client, as the server sees it.

public interface INetConnection

Properties

Buffer

Storage for the application's use. BSGameLib does not read or write it.

byte[] Buffer { get; set; }

Property Value

byte[]

IpAddress

The peer's address, without its port: "127.0.0.1" or "::1".

string IpAddress { get; }

Property Value

string

RemoteId

An identifier for the connection, unique among the connections the server has accepted.

long RemoteId { get; }

Property Value

long

RemotePort

The peer's port.

int RemotePort { get; }

Property Value

int

Methods

Disconnect(string)

Closes the connection. reason is sent to the peer.

void Disconnect(string reason)

Parameters

reason string

Send(IDataPacket)

Not supported on a connection: throws NotSupportedException. Send through IServerAdapter or IClientAdapter instead.

void Send(IDataPacket packet)

Parameters

packet IDataPacket