> For the complete documentation index, see [llms.txt](https://tariksavas.gitbook.io/tarnet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tariksavas.gitbook.io/tarnet/docs/how-to-use/isocketserver/stop.md).

# Stop

```csharp
void Stop()
```

* **Description:**\
  This method is used to stop a running socket server. It halts the server, stops listening for new connections, and closes active connections. For both TCP and UDP servers, this method prevents further operations and releases resources.
* **Parameters:**\
  This method does not take any parameters.
* **Returns:**\
  This method does not return any value; the server is stopped.

***

The `Stop()` method is used to stop a running socket server. When invoked, the server ceases to accept new connections, and all active connections are closed. It halts the server’s operations, freeing up resources.

* **TCP Server:** In a TCP server, the `Stop()` method terminates active connections and stops listening for incoming connections. All active client connections are closed, and the server will not accept any new connections. To restart the server, the `Start()` method must be called again.
* **UDP Server:** In a UDP server, the `Stop()` method stops receiving incoming data packets. Since UDP is connectionless, it does not close any connections. The server simply stops listening for incoming messages.

***

**Important Notes:**

* When the `Stop()` method is invoked, all active connections are terminated, and operations are halted. To restart the server, the `Start()` method needs to be called again.
* After the server is stopped, no further data exchange occurs, as the connections are closed.

***

**Usage:**

```csharp
socketServer.Stop();
```
