SToolkit.SocketNetwork
1.0.0
Clienteservidor de soquete TCPUDP assíncrono, de alto desempenho e poderoso.
Pacote Nuget
Ou console Nuget
Install-Package SToolkit.SocketNetwork
#1 #2
Incluindo
using SToolkit . SocketNetwork ;
Criar servidor, TCP
SocketServer TcpServer = new SocketServer ( NetworkType . Tcp , IPAddress . Loopback , 5400 ) ;
ou UDP
SocketServer UdpServer = new SocketServer ( NetworkType . Udp , IPAddress . Loopback , 5401 ) ;
Em seguida, vincule eventos
Iniciar servidor
TcpServer . Start ( ) ;
UdpServer . Start ( ) ;
Todas as funções do servidor
SocketServer ( NetworkType type , IPAddress address , int port ) ;
void Dispose ( ) ;
void Start ( ) ;
void Stop ( ) ;
Todas as variáveis do servidor
string Uid ;
IPAddress IPAddress ;
int Port ;
List < ClientConnection > ConnectedClients ;
int LoopInterval ;
int Backlog ;
NetworkType ServerType ;
bool UDPClientManage ;
int UDPDataInterval ;
Incluindo
using SToolkit . SocketNetwork ;
Criar cliente, TCP
SocketClient TcpClient = new SocketClient ( NetworkType . Tcp ) ;
ou UDP
SocketClient UdpClient = new SocketClient ( NetworkType . Udp ) ;
Vincular eventos
Conecte-se ao servidor remoto
TcpClient . Connect ( IPAddress . Loopback , 5400 ) ;
UdpClient . Connect ( IPAddress . Loopback , 5401 ) ;
Todas as funções do cliente
SocketClient ( NetworkType type ) ;
void Dispose ( ) ;
void Connect ( IPAddress address , int port ) ;
void Connect ( IPEndPoint point ) ;
void Disconnect ( ) ;
Todas as variáveis do cliente
NetworkType ClientType ;
int LoopInterval ;
int UDPDataInterval ;