Xeno-rat
Loading...
Searching...
No Matches
Plugin.Socks5Handler Class Reference
Collaboration diagram for Plugin.Socks5Handler:

Public Member Functions

 Socks5Handler (Node subnode)
 
async Task Start ()
 Asynchronously starts the communication process with the specified destination address and port.
 

Private Member Functions

Socket CreateSocket (int TIMEOUT_SOCKET)
 Creates a new socket with the specified timeout value.
 
async Task DisconnectSockAsync (Socket sock)
 Asynchronously disconnects the specified socket.
 
async Task RecvSendLoop (Socket remote_socket, Node subnode, int bufferSize)
 Asynchronously receives and sends data between the remote socket and subnode using the specified buffer size.
 

Private Attributes

Node subnode
 

Constructor & Destructor Documentation

◆ Socks5Handler()

Plugin.Socks5Handler.Socks5Handler ( Node subnode)
inline

Member Function Documentation

◆ CreateSocket()

Socket Plugin.Socks5Handler.CreateSocket ( int TIMEOUT_SOCKET)
inlineprivate

Creates a new socket with the specified timeout value.

Parameters
TIMEOUT_SOCKETThe timeout value for the socket.
Returns
A new socket with the specified timeout value.
Exceptions
SocketExceptionThrown when failed to create the socket.
Here is the caller graph for this function:

◆ DisconnectSockAsync()

async Task Plugin.Socks5Handler.DisconnectSockAsync ( Socket sock)
inlineprivate

Asynchronously disconnects the specified socket.

Parameters
sockThe socket to be disconnected.

This method asynchronously disconnects the specified sock by delaying the task for 10 milliseconds and then using the Task.Factory.FromAsync method to perform the disconnection operation. If the sock is not null, it is disconnected; otherwise, no action is taken. If an exception occurs during the disconnection process, the sock is closed with a linger state of 0.

Exceptions
ObjectDisposedExceptionThrown if the socket has been closed and is no longer available for use.
Here is the caller graph for this function:

◆ RecvSendLoop()

async Task Plugin.Socks5Handler.RecvSendLoop ( Socket remote_socket,
Node subnode,
int bufferSize )
inlineprivate

Asynchronously receives and sends data between the remote socket and subnode using the specified buffer size.

Parameters
remote_socketThe remote socket to receive and send data.
subnodeThe subnode to receive and send data.
bufferSizeThe size of the buffer used for receiving and sending data.
Returns

This method continuously checks for available data on the remote socket and subnode, and asynchronously receives and sends data between them. If no data is available on the remote socket or subnode, the method waits for 100 milliseconds before checking again. The method returns when the remote socket is no longer connected or when the subnode is disconnected.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Start()

async Task Plugin.Socks5Handler.Start ( )
inline

Asynchronously starts the communication process with the specified destination address and port.

Returns
Task representing the asynchronous operation.

This method asynchronously starts the communication process with the specified destination address and port. It first receives the destination address, port, and timeout from the subnode. Then it creates a socket and attempts to connect to the specified destination address and port. If the connection attempt throws a SocketException, it handles specific socket errors (TimedOut, HostUnreachable) and sends corresponding error messages back to the subnode. If the connection is successful, it sends an "OK" message to the subnode and continues with the communication process by sending and receiving data in a loop.

Exceptions
SocketExceptionThrown when a socket error occurs during the connection attempt.
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ subnode

Node Plugin.Socks5Handler.subnode
private

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