How can I obtain the local TCP port and IP Address of my client program?

后端 未结 2 710
孤独总比滥情好
孤独总比滥情好 2021-01-13 15:49

I\'m prepping for a simple work project and am trying to familiarize myself with the basics of socket programming in a Unix dev environment. At this point, I have some basic

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-13 16:22

    From the looks of your code you are not doing connect or accept on the socket. Until you have done this the data you get from getsockname is undefined.

提交回复
热议问题