-
Notifications
You must be signed in to change notification settings - Fork 11
RakNetServer
Olybear9 edited this page Jul 18, 2021
·
1 revision
The RakNetServer struct is defined as follows:
pub struct RakNetServer {
pub address: String,
pub version: RakNetVersion,
pub connections: Arc<Mutex<HashMap<String, Connection>>>,
pub start_time: SystemTime
}| Parameter | Type | Description |
|---|---|---|
| address | String |
A string containing a valid origin address. EG: 192.168.0.1:19132
|
Creates a instance which can later be started.
Example:
let mut server = RakNetServer::new(String::from("0.0.0.0:19132"));start() -> (JoinHandle<()>, JoinHandle<()>)
| Return Type | Description |
|---|---|
Tuple<JoinHandle,JoinHandle>
|
A tuple of the Threads started by RakNet |
Starts the two Client and Server threads for accepting connections with RakNet.
Example:
let (send, recv) = server.start();
send.join().unwrap();
recv.join().unwrap();These handles are returned to allow ease when making RakNet concurrently.