Xeno-rat
Loading...
Searching...
No Matches
xeno_rat_server.Listener Class Reference
Collaboration diagram for xeno_rat_server.Listener:

Public Member Functions

 Listener (Func< Socket, Task > _ConnectCallBack)
 
bool PortInUse (int port)
 Checks if the specified port is in use.
 
void CreateListener (int port)
 Creates a listener on the specified port and starts listening for incoming connections.
 
void StopListener (int port)
 Stops the listener on the specified port.
 

Public Attributes

Dictionary< int, _listenerlisteners = new Dictionary<int, _listener>()
 

Private Attributes

Func< Socket, Task > ConnectCallBack
 

Constructor & Destructor Documentation

◆ Listener()

xeno_rat_server.Listener.Listener ( Func< Socket, Task > _ConnectCallBack)
inline

Member Function Documentation

◆ CreateListener()

void xeno_rat_server.Listener.CreateListener ( int port)
inline

Creates a listener on the specified port and starts listening for incoming connections.

Parameters
portThe port number on which to create the listener.
Exceptions
System.InvalidOperationExceptionThrown when the specified port is already in use.

This method checks if the specified port is in use. If the port is available, it creates a new listener and starts listening for incoming connections using the specified port . If an error occurs during the process, the listener is stopped, and an error message is displayed.

Here is the call graph for this function:

◆ PortInUse()

bool xeno_rat_server.Listener.PortInUse ( int port)
inline

Checks if the specified port is in use.

Parameters
portThe port number to be checked.
Returns
True if the port is in use; otherwise, false.
Here is the caller graph for this function:

◆ StopListener()

void xeno_rat_server.Listener.StopListener ( int port)
inline

Stops the listener on the specified port.

Parameters
portThe port number on which the listener is running.

This method stops the listener running on the specified port .

Member Data Documentation

◆ ConnectCallBack

Func<Socket, Task> xeno_rat_server.Listener.ConnectCallBack
private

◆ listeners

Dictionary<int, _listener> xeno_rat_server.Listener.listeners = new Dictionary<int, _listener>()

The documentation for this class was generated from the following file: