C# Класс FastNetwork.SocketServer

socket 服务器
Наследование: BaseSocketServer
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
AddListener ( string name, IPEndPoint endPoint ) : ISocketListener

add socket listener

SocketServer ( IServerHandler handler, IEncoder encoder, IDecoder decoder ) : System

使用默认配置参数的构造函数

SocketServer ( IServerHandler handler, Protocol protocol, int socketBufferSize, int messageBufferSize, int maxMessageSize, int maxConnections ) : System

new

Start ( ) : void

start

Stop ( ) : void

stop

Защищенные методы

Метод Описание
OnConnected ( IConnection connection ) : void

OnConnected

OnDisconnected ( IConnection connection, Exception ex ) : void

OnDisconnected

OnError ( IConnection connection, Exception ex ) : void

onError

OnMessageReceived ( IConnection connection, MessageReceivedEventArgs e ) : void

OnMessageReceived

OnSendCallback ( IConnection connection, SendCallbackEventArgs e ) : void

send callback

OnStartSending ( IConnection connection, Packet packet ) : void

start sending

Приватные методы

Метод Описание
listener_Accepted ( ISocketListener listener, IConnection connection ) : void

socket accepted handler

Описание методов

AddListener() публичный Метод

add socket listener
public AddListener ( string name, IPEndPoint endPoint ) : ISocketListener
name string
endPoint System.Net.IPEndPoint
Результат ISocketListener

OnConnected() защищенный Метод

OnConnected
protected OnConnected ( IConnection connection ) : void
connection IConnection
Результат void

OnDisconnected() защищенный Метод

OnDisconnected
protected OnDisconnected ( IConnection connection, Exception ex ) : void
connection IConnection
ex System.Exception
Результат void

OnError() защищенный Метод

onError
protected OnError ( IConnection connection, Exception ex ) : void
connection IConnection
ex System.Exception
Результат void

OnMessageReceived() защищенный Метод

OnMessageReceived
protected OnMessageReceived ( IConnection connection, MessageReceivedEventArgs e ) : void
connection IConnection
e FastNetwork.Event.MessageReceivedEventArgs
Результат void

OnSendCallback() защищенный Метод

send callback
protected OnSendCallback ( IConnection connection, SendCallbackEventArgs e ) : void
connection IConnection
e SendCallbackEventArgs
Результат void

OnStartSending() защищенный Метод

start sending
protected OnStartSending ( IConnection connection, Packet packet ) : void
connection IConnection
packet Packet
Результат void

SocketServer() публичный Метод

使用默认配置参数的构造函数
public SocketServer ( IServerHandler handler, IEncoder encoder, IDecoder decoder ) : System
handler IServerHandler
encoder IEncoder
decoder IDecoder
Результат System

SocketServer() публичный Метод

new
socketService is null. protocol is null. maxMessageSize maxConnections
public SocketServer ( IServerHandler handler, Protocol protocol, int socketBufferSize, int messageBufferSize, int maxMessageSize, int maxConnections ) : System
handler IServerHandler
protocol Protocol
socketBufferSize int
messageBufferSize int
maxMessageSize int
maxConnections int
Результат System

Start() публичный Метод

start
public Start ( ) : void
Результат void

Stop() публичный Метод

stop
public Stop ( ) : void
Результат void