-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Conversation
a1fcf87
to
61178f1
Compare
src/thin_client.rs
Outdated
pub addr: SocketAddr, | ||
pub requests_socket: UdpSocket, | ||
pub events_socket: UdpSocket, | ||
addr: SocketAddr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rename that to requests_addr
?
src/thin_client.rs
Outdated
addr: SocketAddr, | ||
requests_socket: UdpSocket, | ||
events_socket: UdpSocket, | ||
events_addr: SocketAddr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put that before events_socket
so that it's consistent with the requests addr/socket pair?
src/thin_client.rs
Outdated
@@ -27,11 +28,17 @@ impl ThinClient { | |||
/// Create a new ThinClient that will interface with Rpu | |||
/// over `requests_socket` and `events_socket`. To receive responses, the caller must bind `socket` | |||
/// to a public address before invoking ThinClient methods. | |||
pub fn new(addr: SocketAddr, requests_socket: UdpSocket, events_socket: UdpSocket) -> Self { | |||
pub fn new( | |||
addr: SocketAddr, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, requests_addr
and reorder the events args.
@@ -152,6 +158,22 @@ impl ThinClient { | |||
} | |||
} | |||
|
|||
#[cfg(test)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to guard this with #[cfg(test)]
. This is useful!
src/bin/client-demo.rs
Outdated
@@ -148,7 +154,13 @@ fn main() { | |||
let requests_port = events_addr.port(); | |||
events_addr.set_port(requests_port + 1); | |||
let events_socket = UdpSocket::bind(&events_addr).unwrap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem right. You want to bind
to the same address you're going to send_to
?
…ion installation (solana-labs#234) * feat: check user's permissions in Windows * feat: Remove check fun and check os_err * fmt and optimize code
…ion installation (#234) * feat: check user's permissions in Windows * feat: Remove check fun and check os_err * fmt and optimize code
No description provided.