whenever i execute server every time i need to change the port no.
if i don’t change its sayin “bind: address in use”..?????
whenever i execute server every time i need to change the port no.
if i don’t change its sayin “bind: address in use”..?????
EmbLogic Research & Competency Development Labs
Phone: +91 9818467776, 8527567776, 9650467776
Email: info@emblogic.com
Copyright © EmbLogic Embedded Technologies Pvt. Ltd.
Reason:If the server cannot bind to the port this means that there is already a process listening on that port number or there is some other issue with your TCP stack.
Imnplement the below system call before calling bind function.
int socket_desc; /* master socket returned by socket() */
int opt=TRUE; /* option is to be on/TRUE or off/FALSE */
setsockopt(socket_desc,SOL_SOCKET,SO_REUSEPORT,
(char *)&opt,sizeof(opt));