# How to print the foreign port (under netinet tcpip code)



## DiscountBSD (Nov 17, 2010)

This is my first post on FreeBSD. Hello all.

I am currently doing some debugging. I would like to view the foreign port in a socket (incoming connection). I tried sotoinpbc(so)->inp_fport but that only shows 0 as the foreign port.

Thanks


----------

