Skip to content

Differents type signature (address, port) for TCP and UDP connection #18269

Closed
@rach

Description

@rach

Hi,

The closest ticket that I could find was #14755 but it seems closed due to inactivity.
There is maybe a reason but I found a bit odd that TCP connection is done via ( &str , u16 ) and UDP via std::io::net::ip::SocketAddr . Looking at the history it seem like TCP changed to step away from SocketAddr.

TCP:

pub fn bind(addr: &str, port: u16) -> IoResult<TcpListener> {

UDP:

pub fn bind(addr: SocketAddr) -> IoResult<UdpSocket> {

Thanks.

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