C# Class TrotiNet.TcpServer

Implementation of a TCP/IP server
Afficher le fichier Open project: Gizeta/Nekoxy-fiddler Class Usage Examples

Protected Properties

Свойство Type Description
ConnectedSockets HttpSocket>.Dictionary
LocalPort int

Méthodes publiques

Méthode Description
Start ( OnNewClient onConnection ) : void

Spawn a thread that listens to incoming connections

Stop ( ) : void

Stop the listening threads and close the client sockets

TcpServer ( int localPort, bool bUseIPv6 ) : System

Initialize, but do not start, a multi-threaded TCP server listening for localhost connections only

Méthodes protégées

Méthode Description
AcceptCallback ( IAsyncResult ar ) : void

Callback method for accepting new connections

CheckSockets ( object eventState ) : void

Close broken sockets

This function is called regularly to clean up the list of connected sockets.

CloseSocket ( HttpSocket state ) : void

Remove the socket contained in the given state object from the connected array list and hash table, then close the socket

Pause ( ) : void
StartListening ( Socket &ListeningSocket ) : void

Open a listener socket and wait for connections

StartThread ( ) : void

Method Details

AcceptCallback() protected méthode

Callback method for accepting new connections
protected AcceptCallback ( IAsyncResult ar ) : void
ar IAsyncResult
Résultat void

CheckSockets() protected méthode

Close broken sockets
This function is called regularly to clean up the list of connected sockets.
protected CheckSockets ( object eventState ) : void
eventState object
Résultat void

CloseSocket() protected méthode

Remove the socket contained in the given state object from the connected array list and hash table, then close the socket
protected CloseSocket ( HttpSocket state ) : void
state HttpSocket
Résultat void

Pause() protected méthode

protected Pause ( ) : void
Résultat void

Start() public méthode

Spawn a thread that listens to incoming connections
public Start ( OnNewClient onConnection ) : void
onConnection OnNewClient
Résultat void

StartListening() protected méthode

Open a listener socket and wait for connections
protected StartListening ( Socket &ListeningSocket ) : void
ListeningSocket Socket
Résultat void

StartThread() protected méthode

protected StartThread ( ) : void
Résultat void

Stop() public méthode

Stop the listening threads and close the client sockets
public Stop ( ) : void
Résultat void

TcpServer() public méthode

Initialize, but do not start, a multi-threaded TCP server listening for localhost connections only
public TcpServer ( int localPort, bool bUseIPv6 ) : System
localPort int TCP port to listen to
bUseIPv6 bool /// If true, listen on ::1 only. If false, listen on 127.0.0.1 only. ///
Résultat System

Property Details

ConnectedSockets protected_oe property

Set of open sockets, indexed by socket identifier
protected Dictionary ConnectedSockets
Résultat HttpSocket>.Dictionary

LocalPort protected_oe property

Port used for local browser-proxy communication
protected int LocalPort
Résultat int