Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Api bind()错误:无法分配请求的地址_Api_Bind - Fatal编程技术网

Api bind()错误:无法分配请求的地址

Api bind()错误:无法分配请求的地址,api,bind,Api,Bind,绑定错误:无法分配请求的地址 新插座=插座插座,插座内存,0 localIP = "128.1.1.64"; memset(&socket_data, 0, sizeof(socket_data)); // Fill the socket structure socket_data.sin_family = AF_INET; socket_data.sin_addr.s_addr = inet_addr(localIP); socket_data.sin_port

绑定错误:无法分配请求的地址

新插座=插座插座,插座内存,0

localIP = "128.1.1.64";

memset(&socket_data, 0, sizeof(socket_data));

// Fill the socket structure
socket_data.sin_family      = AF_INET;
socket_data.sin_addr.s_addr = inet_addr(localIP);
socket_data.sin_port        = htons(PortNumber);
绑定新的\u套接字、结构sockaddr*&套接字\u数据、sizeofsocket\u数据


有人知道绑定失败的原因吗?

您已经有一个套接字绑定到该地址/端口组合,我猜这是一个任意的IP,128.1.1.64在您的任何网络接口中都不存在。如果您想欺骗源IP,可能需要使用原始套接字