|
From: | Mattia Settin |
Subject: | Re: [lwip-users] access to tcp_pcb data from socket+ |
Date: | Wed, 7 Mar 2018 11:05:03 +0100 |
HiYes you are right but I don't need to touch the pcb, just some check on the pcb.getpeername stores the address of the peer that is connected socket (it dosen't return the pcb structure).Which is the api for retrive the connection tcp data for a certain socket ?ThanksreagardsmOn Wed, Mar 7, 2018 at 10:26 AM, Jens Nielsen <address@hidden> wrote:Hi
The short answer is: don't. If you're using the socket api you're not touching the pcb.
What do you really want to do? There are basically two options here
a) Just like your question about getpeername, there's an api for that. Google is your friend.
or
b) Since the beginning of time people have managed without it, in which case you're probably doing something weird and you're probably on your own
BR /Jens
On 2018-03-07 10:07, Mattia Settin wrote:
Dear allI developing an application wih lwip 2.0.3 using socket bsd.The tcp server performs the following operation:s = socket()bindaccept //wait a new connectionread //packet received
I need to perform some check on the pcb data of my socket.I note the get_socket is defined as static and the get_sockopt do not return all data I need.I solve adding following function in socket.c:struct tcp_pcb * lwip_getsockpcb(int s)
{
struct lwip_sock *sock = get_socket(s);
if (!sock) {
return NULL;
}
return sock->conn->pcb.tcp;
}
My question is:how can acces to the tcp_pcb of my socket with out modify the library ?Which is the smart way ?Thank allregard
--
Mattia SettinSoftware and System Engineer
_______________________________________________ lwip-users mailing list address@hidden https://lists.nongnu.org/mailm an/listinfo/lwip-users
_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users
--Mattia SettinSoftware and System Engineer
[Prev in Thread] | Current Thread | [Next in Thread] |