> For the complete documentation index, see [llms.txt](https://cavonstavants-organization.gitbook.io/rtype-technical-documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cavonstavants-organization.gitbook.io/rtype-technical-documentation/index_classes/classnetwork_1_1_client.md).

# network::Client

[More...](#detailed-description)

`#include <NetworkClient.hpp>`

## Public Functions

|                                                                                                                                                                                                                                                                                        | Name                                                                                                                                                                         |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|                                                                                                                                                                                                                                                                                        | [**\~Client**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_client.md#function-~client)()                        |
| void                                                                                                                                                                                                                                                                                   | [**setHost**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_client.md#function-sethost)(const std::string & host) |
| void                                                                                                                                                                                                                                                                                   | [**setPort**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_client.md#function-setport)(const std::string & port) |
| [LockedQueue](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_locked_queue.md)< [Message](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Namespaces/namespacenetwork.md#typedef-message) > & | [**getOutgoingMessages**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_client.md#function-getoutgoingmessages)() |
| [LockedQueue](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_locked_queue.md)< [Message](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Namespaces/namespacenetwork.md#typedef-message) > & | [**getReceivedMessages**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_client.md#function-getreceivedmessages)() |
| bool                                                                                                                                                                                                                                                                                   | [**getIsConnected**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_client.md#function-getisconnected)()           |
| void                                                                                                                                                                                                                                                                                   | [**setIsConnected**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_client.md#function-setisconnected)()           |
| void                                                                                                                                                                                                                                                                                   | [**connect**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_client.md#function-connect)()                         |
| void                                                                                                                                                                                                                                                                                   | [**disconnect**](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_client.md#function-disconnect)()                   |

## Detailed Description

```cpp
class network::Client;
```

[Client](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_client.md) class is one of the big parts in the game. It represents the way for the gamer to communicate with the servers by sending and receiving some message. To understand those messages in a more specifically way, just refer to the RFC. [Client](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_client.md) is able to join a specific server by a given ip & port, communicating with it using sockets & buffers

## Public Functions Documentation

### function \~Client

```cpp
inline ~Client()
```

Default destructor of the [Client](https://github.com/TEAM-AAAAAAAAAAAAAAAA/RTYPE-TECHNICAL-DOCS/blob/main/Classes/Classes/classnetwork_1_1_client.md) Class

### function setHost

```cpp
static inline void setHost(
    const std::string & host
)
```

Getters & Setters of client Class

### function setPort

```cpp
static inline void setPort(
    const std::string & port
)
```

### function getOutgoingMessages

```cpp
static inline LockedQueue< Message > & getOutgoingMessages()
```

### function getReceivedMessages

```cpp
static inline LockedQueue< Message > & getReceivedMessages()
```

### function getIsConnected

```cpp
static inline bool getIsConnected()
```

### function setIsConnected

```cpp
static inline void setIsConnected()
```

### function connect

```cpp
static inline void connect()
```

Static methods used to connect to the given server (host, port) using udp::v4

### function disconnect

```cpp
static inline void disconnect()
```

***

Updated on 2022-11-13 at 17:21:37 +0100
