linux下一个简单的建立c⼀s间的tcp链接,不知为何connection refused

2025-04-28 23:04:43
推荐回答(1个)
回答1:

server.sin_port=SPORT;改成
server.sin_port=htons(SPORT);