Skip to content

Add get_p2p_session_state and error handling#312

Open
maxpowa wants to merge 1 commit intoNoxime:masterfrom
maxpowa:feat/get-p2p-session-state
Open

Add get_p2p_session_state and error handling#312
maxpowa wants to merge 1 commit intoNoxime:masterfrom
maxpowa:feat/get-p2p-session-state

Conversation

@maxpowa
Copy link
Contributor

@maxpowa maxpowa commented Mar 11, 2026

I considered doing something to replace remote_ip and remote_port with more idiomatic Rust, but it risks losing information if one of the parts is zero'd out. Would rather let the library consumer make that choice.

remote_addr: if state.m_nRemoteIP != 0 && state.m_nRemotePort != 0 {
    Some(SocketAddrV4::new(
        Ipv4Addr::from(state.m_nRemoteIP.to_be_bytes()),
        state.m_nRemotePort,
    ))
} else {
    None
},

@maxpowa maxpowa force-pushed the feat/get-p2p-session-state branch from f3cbe28 to 62f4ed6 Compare March 11, 2026 23:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant