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

Capture and play voice with Asterisk ARI -

visual studio - Installing Packages through Nuget - "Central Directory corrupt" -

java - Why database contraints in HSQLDB are only checked during a commit when using transactions in Hibernate? -