简体   繁体   中英

C++ Linux TCP sockets fd

how do i change the socket id/FD after i use accept() ? lets say i bind() on sockfd 3 and the accepted client is on sockfd 4, how do i change/move that sockfd to 1000?

OS : Ubuntu

Still you didn't specify the OS so I will go with *nix :)

http://linux.die.net/man/2/dup2

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM