On 2021-02-21, mickspud@potatofield.co.uk <mickspud@potatofield.co.uk> wrote:
Hello
Does anyone know how to get the remote TX port of a TCP connection using
What's a "TX port"? TCP has one port number at each endpoint.
the standard C sockets API on linux? Google is proving less than helpful.
The sockets API has an ancient funtion called getpeername for obtaining
the address of the remote endpoint.
Using this API can often be avoided. If you're writing a server
which accepts connections, the accept call gives you each peer's
address.
Hello
Does anyone know how to get the remote TX port of a TCP connection using
the standard C sockets API on linux? Google is proving less than helpful.
In article <20210221090013.364@kylheku.com>,
Kaz Kylheku <563-365-8930@kylheku.com> wrote:
On 2021-02-21, mickspud@potatofield.co.uk <mickspud@potatofield.co.uk> wrote:
HelloWhat's a "TX port"? TCP has one port number at each endpoint.
Does anyone know how to get the remote TX port of a TCP connection using >>
the standard C sockets API on linux? Google is proving less than helpful. >>The sockets API has an ancient funtion called getpeername for obtaining
the address of the remote endpoint.
Using this API can often be avoided. If you're writing a server
which accepts connections, the accept call gives you each peer's
address.
No it doesn't, it just returns the socket FD, and you then call getpeername(). You may be thinking of recvfrom(). This is normally used
with UDP sockets, but I suppose it will also work with TCP.
No it doesn't, it just returns the socket FD, and you then call >getpeername(). You may be thinking of recvfrom(). This is normally used
with UDP sockets, but I suppose it will also work with TCP.
On 2021-02-21, mickspud@potatofield.co.uk <mickspud@potatofield.co.uk> wrote: >> Hello
Does anyone know how to get the remote TX port of a TCP connection using
What's a "TX port"? TCP has one port number at each endpoint.
The sockets API has an ancient funtion called getpeername for obtaining
the address of the remote endpoint.
On Sat, 20 Feb 2021 17:59:47 -0500
Barry Margolin <barmar@alum.mit.edu> wrote:
No it doesn't, it just returns the socket FD, and you then call >>getpeername(). You may be thinking of recvfrom(). This is normally used >>with UDP sockets, but I suppose it will also work with TCP.
Turns out it does and thats what I used in the end.
On Sun, 21 Feb 2021 17:05:58 -0000 (UTC)
Kaz Kylheku <563-365-8930@kylheku.com> wrote:
On 2021-02-21, mickspud@potatofield.co.uk <mickspud@potatofield.co.uk> wrote: >>> Hello
Does anyone know how to get the remote TX port of a TCP connection using
What's a "TX port"? TCP has one port number at each endpoint.
I meant in the sense of the client port, not the server port.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 285 |
Nodes: | 16 (2 / 14) |
Uptime: | 74:04:45 |
Calls: | 6,489 |
Calls today: | 2 |
Files: | 12,096 |
Messages: | 5,275,931 |