Skip to content

Ignore connections that have no peer_addr #500

@seunlanlege

Description

@seunlanlege

If there's no peer_addr most likely the connection has been dropped, I think in this case we should ignore the socket.

let listener = tokio::net::TcpListener::bind(&address)?;
let connections = SuspendableStream::new(listener.incoming());
let server = connections.map(move |socket| {
let peer_addr = socket.peer_addr().expect("Unable to determine socket peer address");
trace!(target: "tcp", "Accepted incoming connection from {}", &peer_addr);
let (sender, receiver) = mpsc::channel(65536);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions