Can request_response send multiple types of data? #5534
Replies: 1 comment
-
I use #[derive(NetworkBehaviour)]
pub struct MyBehaviour {
pub request_response: request_response::cbor::Behaviour<RequestInfo, ResponseInfo>,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum RequestInfo {
FileRequest(String),
REQ,
}
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum ResponseInfo {
FileResponse(Vec<u8>),
ACK,
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there
I have a project where I need to share files, and I implemented this by referring to the file_sharing example
Then I need to specify the peer to send other information, such as a string.
I'm not sure if it's possible to redefine a new request_response parameter like the following
or is it possible to take this request_response parameter?
Are there some examples to refer to?
Beta Was this translation helpful? Give feedback.
All reactions