|
| Socks5Handler (Node subnode) |
|
async Task | Start () |
| Asynchronously starts the communication process with the specified destination address and port.
|
|
|
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.
|
|
◆ Socks5Handler()
Plugin.Socks5Handler.Socks5Handler |
( |
Node | subnode | ) |
|
|
inline |
◆ CreateSocket()
Socket Plugin.Socks5Handler.CreateSocket |
( |
int | TIMEOUT_SOCKET | ) |
|
|
inlineprivate |
Creates a new socket with the specified timeout value.
- Parameters
-
TIMEOUT_SOCKET | The timeout value for the socket. |
- Returns
- A new socket with the specified timeout value.
- Exceptions
-
SocketException | Thrown when failed to create the socket. |
◆ DisconnectSockAsync()
async Task Plugin.Socks5Handler.DisconnectSockAsync |
( |
Socket | sock | ) |
|
|
inlineprivate |
Asynchronously disconnects the specified socket.
- Parameters
-
sock | The 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
-
ObjectDisposedException | Thrown if the socket has been closed and is no longer available for use. |
◆ 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_socket | The remote socket to receive and send data. |
subnode | The subnode to receive and send data. |
bufferSize | The 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.
◆ 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
-
SocketException | Thrown when a socket error occurs during the connection attempt. |
◆ subnode
Node Plugin.Socks5Handler.subnode |
|
private |
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/ReverseProxy/ReverseProxy.cs