c - Bind failed: Address already in use -


i attempting bind socket port below:

if( bind(socket_desc,(struct sockaddr *) &server, sizeof(server)) < 0) {     perror("bind failed. error");     return 1; } puts("bind done"); 

but gives:

$ ./serve    socket created     bind failed. error: address in use 

why error occur?

the error means port trying open being used application try using netstat see ports open , use available port.

also check if binding right ip address (i assuming localhost)


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

c - Unrecognised emulation mode: elf_i386 on MinGW32 -