Skip to content

Commit 04d893c

Browse files
committed
added comments to explain deviation from the book
1 parent cc627d4 commit 04d893c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

ch04/a-epoll/src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
//! The fix for this is to account for false wakeups which is an easy fix but requires
1212
//! a few changes to the example. I've added an explicit comment: "FIX #4", the places
1313
//! I made a change so it's easy to spot the differences to the example code in the book.
14+
//!
15+
//! ## PR #19:
16+
//! To make this example work with Docker for Mac users there is a small change
17+
//! to the code where you can override "localhost" by passing in a command line
18+
//! argument.
1419
1520
use std::{
1621
// FIX #4 (import `HashSet``)
@@ -84,6 +89,7 @@ fn main() -> Result<()> {
8489

8590
let mut streams = vec![];
8691

92+
// FIX #19: Allow to override the base URL by passing it as a command line argument
8793
let base_url = env::args()
8894
.nth(1)
8995
.unwrap_or_else(|| String::from("localhost"));

ch04/b-epoll-mio/src/main.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
//! a few changes to the example. I've added an explicit comment: "FIX #4", the places
1515
//! I made a change so it's easy to spot the differences to the example code in the book.
1616
//!
17+
//! ## PR #19:
18+
//! To make this example work with Docker for Mac users there is a small change
19+
//! to the code where you can override "localhost" by passing in a command line
20+
//! argument.
21+
//!
1722
//! ## TROUBLESHOOTING (KNOWN POTENTIAL ISSUE)
1823
//!
1924
//! ### EXAMPLE DOESN'T WORK AS EXPECTED - PROBLEM WITH DNS LOOKUP
@@ -91,6 +96,7 @@ fn main() -> Result<()> {
9196

9297
let mut streams = vec![];
9398

99+
// FIX #19: Allow to override the base URL by passing it as a command line argument
94100
let base_url = env::args()
95101
.nth(1)
96102
.unwrap_or_else(|| String::from("localhost"));

0 commit comments

Comments
 (0)