C# 클래스 Org.Mentalis.Proxy.Listener

Specifies the basic methods and properties of a Listener object. This is an abstract class and must be inherited.
The Listener class provides an abstract base class that represents a listening socket of the proxy server. Descendant classes further specify the protocol that is used between those two connections.
상속: IDisposable
파일 보기 프로젝트 열기: mcorrientes/Web-Security-Toolset 1 사용 예제들

공개 메소드들

메소드 설명
Dispose ( ) : void

Disposes of the resources (other than memory) used by the Listener.

Stops listening and disposes all the client objects. Once disposed, this object should not be used anymore.

GetClientAt ( int Index ) : Client

Returns the requested client from the client list.

If the specified index is invalid, the GetClientAt method returns null.

GetClientCount ( ) : int

Returns the number of clients in the client list.

GetLocalExternalIP ( ) : IPAddress

Returns an external IP address of this computer, if present.

If this computer does not have any configured IP address, this method returns the IP address 0.0.0.0.

GetLocalInternalIP ( ) : IPAddress

Returns an internal IP address of this computer, if present.

If this computer does not have any configured IP address, this method returns the IP address 0.0.0.0.

Listener ( int Port, IPAddress Address ) : System

Initializes a new instance of the Listener class.

For the security of your server, try to avoid to listen on every network card (IPAddress.Any). Listening on a local IP address is usually sufficient and much more secure.

OnAccept ( IAsyncResult ar ) : void

Called when there's an incoming client connection waiting to be accepted.

Start ( ) : void

Starts listening on the selected IP address and port.

ToString ( ) : string

Returns a string representation of this object.

보호된 메소드들

메소드 설명
AddClient ( Client client ) : void

Adds the specified Client to the client list.

A client will never be added twice to the list.

IsLocalIP ( IPAddress IP ) : bool

Checks whether the specified IP address is a local IP address or not.

IsRemoteIP ( IPAddress IP ) : bool

Checks whether the specified IP address is a remote IP address or not.

RemoveClient ( Client client ) : void

Removes the specified Client from the client list.

Restart ( ) : void

Restarts listening on the selected IP address and port.

This method is automatically called when the listening port or the listening IP address are changed.

메소드 상세

AddClient() 보호된 메소드

Adds the specified Client to the client list.
A client will never be added twice to the list.
protected AddClient ( Client client ) : void
client Client The client to add to the client list.
리턴 void

Dispose() 공개 메소드

Disposes of the resources (other than memory) used by the Listener.
Stops listening and disposes all the client objects. Once disposed, this object should not be used anymore.
public Dispose ( ) : void
리턴 void

GetClientAt() 공개 메소드

Returns the requested client from the client list.
If the specified index is invalid, the GetClientAt method returns null.
public GetClientAt ( int Index ) : Client
Index int The index of the requested client.
리턴 Client

GetClientCount() 공개 메소드

Returns the number of clients in the client list.
public GetClientCount ( ) : int
리턴 int

GetLocalExternalIP() 공개 정적인 메소드

Returns an external IP address of this computer, if present.
If this computer does not have any configured IP address, this method returns the IP address 0.0.0.0.
public static GetLocalExternalIP ( ) : IPAddress
리턴 System.Net.IPAddress

GetLocalInternalIP() 공개 정적인 메소드

Returns an internal IP address of this computer, if present.
If this computer does not have any configured IP address, this method returns the IP address 0.0.0.0.
public static GetLocalInternalIP ( ) : IPAddress
리턴 System.Net.IPAddress

IsLocalIP() 보호된 정적인 메소드

Checks whether the specified IP address is a local IP address or not.
protected static IsLocalIP ( IPAddress IP ) : bool
IP System.Net.IPAddress The IP address to check.
리턴 bool

IsRemoteIP() 보호된 정적인 메소드

Checks whether the specified IP address is a remote IP address or not.
protected static IsRemoteIP ( IPAddress IP ) : bool
IP System.Net.IPAddress The IP address to check.
리턴 bool

Listener() 공개 메소드

Initializes a new instance of the Listener class.
For the security of your server, try to avoid to listen on every network card (IPAddress.Any). Listening on a local IP address is usually sufficient and much more secure.
public Listener ( int Port, IPAddress Address ) : System
Port int The port to listen on.
Address System.Net.IPAddress The address to listen on. You can specify IPAddress.Any to listen on all installed network cards.
리턴 System

OnAccept() 공개 추상적인 메소드

Called when there's an incoming client connection waiting to be accepted.
public abstract OnAccept ( IAsyncResult ar ) : void
ar IAsyncResult The result of the asynchronous operation.
리턴 void

RemoveClient() 보호된 메소드

Removes the specified Client from the client list.
protected RemoveClient ( Client client ) : void
client Client The client to remove from the client list.
리턴 void

Restart() 보호된 메소드

Restarts listening on the selected IP address and port.
This method is automatically called when the listening port or the listening IP address are changed.
There was an error while creating the listening socket.
protected Restart ( ) : void
리턴 void

Start() 공개 메소드

Starts listening on the selected IP address and port.
There was an error while creating the listening socket.
public Start ( ) : void
리턴 void

ToString() 공개 추상적인 메소드

Returns a string representation of this object.
public abstract ToString ( ) : string
리턴 string