Skip to content

Setting TCP_NODELAY does not work using std::net::TcpStream #218

Closed
@jothan

Description

@jothan

I tried this code:

// Wi-Fi setup, etc....

let s = std::net::TcpStream::connect(("example.com", 80))?;
log::info!("socket connected");
if let Err(e) = s.set_nodelay(true) {
    log::error!("nodelay error: {e:?}");
};

I expected to see this happen: the socket should have been put in nodelay mode without issue.

Instead, this happened:

I (5067) myproject: socket connected
E (5067) myproject: nodelay error: Os { code: 109, kind: Uncategorized, message: "Protocol not available" }

The TCP_NODELAY option should be supported: https://docs.espressif.com/projects/esp-idf/en/v5.2.1/esp32/api-guides/lwip.html#tcp-options

Meta

rustc --version --verbose:

rustc 1.77.0-nightly (424037dcb 2024-03-18) (1.77.0.0)
binary: rustc
commit-hash: 424037dcb6937656992747c4bbff310c40061498
commit-date: 2024-03-18
host: x86_64-unknown-linux-gnu
release: 1.77.0-nightly
LLVM version: 17.0.1
  • ESP-IDF 5.2.1
  • esp-idf-sys 0.34.1
  • esp-idf-svc 0.48.1
  • esp-idf-hal 0.43.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions