Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Send events to the right address #234

Merged
merged 1 commit into from
May 22, 2018

Conversation

sakridge
Copy link
Contributor

No description provided.

@sakridge sakridge force-pushed the fix_events_addr branch 2 times, most recently from a1fcf87 to 61178f1 Compare May 22, 2018 19:11
pub addr: SocketAddr,
pub requests_socket: UdpSocket,
pub events_socket: UdpSocket,
addr: SocketAddr,
Copy link
Contributor

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?

addr: SocketAddr,
requests_socket: UdpSocket,
events_socket: UdpSocket,
events_addr: SocketAddr,
Copy link
Contributor

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?

@@ -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,
Copy link
Contributor

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)]
Copy link
Contributor

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!

@@ -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();
Copy link
Contributor

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?

@garious garious merged commit abfd7d6 into solana-labs:master May 22, 2018
wen-coding pushed a commit to wen-coding/solana that referenced this pull request Mar 18, 2024
…ion installation (solana-labs#234)

* feat: check user's permissions in Windows

* feat: Remove check fun and check os_err

* fmt and optimize code
willhickey pushed a commit that referenced this pull request Mar 20, 2024
…ion installation (#234)

* feat: check user's permissions in Windows

* feat: Remove check fun and check os_err

* fmt and optimize code
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants