|
| Chat (Node _client) |
|
async Task | HeartBeat () |
| Sends a heartbeat signal to the connected client at regular intervals.
|
|
async Task | RecvThread () |
| Asynchronously receives data from the client and updates the UI with the received message.
|
|
|
override void | Dispose (bool disposing) |
| Releases the unmanaged resources used by the component and optionally releases the managed resources.
|
|
◆ Chat()
xeno_rat_server.Forms.Chat.Chat |
( |
Node | _client | ) |
|
|
inline |
◆ button1_Click()
async void xeno_rat_server.Forms.Chat.button1_Click |
( |
object | sender, |
|
|
EventArgs | e ) |
|
inlineprivate |
Handles the button click event and sends the input message to the client.
- Parameters
-
sender | The object that raised the event. |
e | The event data. |
- Returns
- Void
This method retrieves the input message from the textBox2 control, clears the textBox2 control, and sends the message to the client using the SendAsync method of the client object. If the SendAsync method returns false, the form is closed. The input message is then appended to the textBox1 control with the prefix "You:", and the control is scrolled to the end to display the new message.
◆ Chat_Load()
void xeno_rat_server.Forms.Chat.Chat_Load |
( |
object | sender, |
|
|
EventArgs | e ) |
|
inlineprivate |
Called when the Chat form is loaded.
◆ Dispose()
override void xeno_rat_server.Forms.Chat.Dispose |
( |
bool | disposing | ) |
|
|
inlineprotected |
Releases the unmanaged resources used by the component and optionally releases the managed resources.
- Parameters
-
disposing | true to release both managed and unmanaged resources; false to release only unmanaged resources. |
This method releases the unmanaged resources used by the component and optionally releases the managed resources. If disposing is true, this method disposes of the managed resources.
◆ HeartBeat()
async Task xeno_rat_server.Forms.Chat.HeartBeat |
( |
| ) |
|
|
inline |
Sends a heartbeat signal to the connected client at regular intervals.
This method continuously sends a heartbeat signal to the connected client every 2 seconds to maintain the connection. If the client is no longer connected, the method will terminate.
◆ InitializeAsync()
async Task xeno_rat_server.Forms.Chat.InitializeAsync |
( |
| ) |
|
|
inlineprivate |
Initializes the asynchronous tasks for heart beat and receiving messages.
This method initializes the asynchronous tasks for heart beat and receiving messages. The HeartBeat method is called to start the heart beat process, and the RecvThread method is awaited to receive messages asynchronously.
◆ InitializeComponent()
void xeno_rat_server.Forms.Chat.InitializeComponent |
( |
| ) |
|
|
inlineprivate |
Initializes the components of the chat window.
This method initializes the text boxes, button, and other components of the chat window, setting their properties and event handlers.
◆ RecvThread()
async Task xeno_rat_server.Forms.Chat.RecvThread |
( |
| ) |
|
|
inline |
Asynchronously receives data from the client and updates the UI with the received message.
This method continuously receives data from the connected client using asynchronous operations. Upon receiving data, it decodes the byte array into a string message using UTF-8 encoding and appends it to the UI textbox, along with the prefix "User:". It then scrolls the textbox to display the latest message. If the client is disconnected, the method closes the form if it is not already disposed.
◆ textBox1_TextChanged()
void xeno_rat_server.Forms.Chat.textBox1_TextChanged |
( |
object | sender, |
|
|
EventArgs | e ) |
|
inlineprivate |
Event handler for the TextChanged event of textBox1.
- Parameters
-
sender | The object that raised the event. |
e | The event arguments. |
This method is called when the text in textBox1 changes. It can be used to perform actions based on the changed text.
◆ textBox2_KeyDown()
void xeno_rat_server.Forms.Chat.textBox2_KeyDown |
( |
object | sender, |
|
|
KeyEventArgs | e ) |
|
inlineprivate |
Handles the KeyDown event for textBox2 and performs a click on button1 if the Enter key is pressed.
- Parameters
-
sender | The object that raised the event. |
e | A KeyEventArgs that contains the event data. |
This method checks if the Enter key is pressed and, if so, simulates a click on button1. It then sets the KeyEventArgs properties e.Handled and e.SuppressKeyPress to true to indicate that the key event has been handled and the key press should be suppressed.
◆ textBox2_TextChanged()
void xeno_rat_server.Forms.Chat.textBox2_TextChanged |
( |
object | sender, |
|
|
EventArgs | e ) |
|
inlineprivate |
Event handler for the TextChanged event of textBox2.
- Parameters
-
sender | The source of the event. |
e | The EventArgs that contains the event data. |
◆ button1
System.Windows.Forms.Button xeno_rat_server.Forms.Chat.button1 |
|
private |
◆ client
Node xeno_rat_server.Forms.Chat.client |
|
private |
◆ components
System.ComponentModel.IContainer xeno_rat_server.Forms.Chat.components = null |
|
private |
Required designer variable.
◆ textBox1
System.Windows.Forms.TextBox xeno_rat_server.Forms.Chat.textBox1 |
|
private |
◆ textBox2
System.Windows.Forms.TextBox xeno_rat_server.Forms.Chat.textBox2 |
|
private |
The documentation for this class was generated from the following files:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/xeno rat server/Forms/Chat.cs
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/xeno rat server/Forms/Chat.Designer.cs