bind: Socket operation on non-socket问题解决

Posted studying~

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了bind: Socket operation on non-socket问题解决相关的知识,希望对你有一定的参考价值。

问题代码:

int s_fd; 
	if(s_fd = socket(AF_INET,SOCK_STREAM,0) < 0)
	
		perror("socket:");
		exit(1);
	

改成

int s_fd = socket(AF_INET,SOCK_STREAM,0);
	if(s_fd < 0)
	
		perror("socket:");
		exit(1);
	

以上是关于bind: Socket operation on non-socket问题解决的主要内容,如果未能解决你的问题,请参考以下文章