You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
617 B
26 lines
617 B
3 years ago
|
//! This module implements the client-server game protocol
|
||
|
|
||
|
use super::{Request, Response};
|
||
|
|
||
|
pub enum NetErr {
|
||
|
Refused,
|
||
|
Dropped,
|
||
|
Timeout,
|
||
|
BadData,
|
||
|
}
|
||
|
|
||
|
/// Use this function to send a request to a partical remote
|
||
|
///
|
||
|
/// The function makes sure that you get a valid response back, but
|
||
|
/// does not yet ensure that this response is correct for the request
|
||
|
/// in question.
|
||
|
pub fn request_to(r: Request, remote: String) -> Result<Response, NetErr> {
|
||
|
todo!()
|
||
|
}
|
||
|
|
||
|
/// Use this function to send a response to a client
|
||
|
pub fn response_to(r: Response, client: String) -> Result<(), NetErr> {
|
||
|
todo!()
|
||
|
}
|
||
|
|