socket编程send函数的错误时10038是什么意思?

2025-03-18 11:52:45
推荐回答(3个)
回答1:

10038是错误代码,叫做Errorcode,对此官方有定义了对应的Errorcode表可以查询,

经过查询这个错误代码表示的是 Socket operation on non-socket 也就是说send函数使用的socket是无效的,不存在的。
参考https://support.microsoft.com/zh-cn/kb/819124/zh-cn
WSAENOTSOCK (10038)
说明: 操作已尝试某件事不是一个套接字。套接字句柄参数未引用有效的套接字,或者为选择 (Wsapiref_1ab6.asp) 中,fd_set 的成员已无效。

回答2:

(所谓socket通常也称作"套接字",用于描述IP地址和端口,是一个通信链的函数错误代码:10057;请求的连接未成功建立。 ,TrCWkp

回答3:

WSAENOTSOCK
10038
Socket operation on nonsocket.
An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for select, a member of an fd_set was not valid.
也就是说 send操作的套接字对象不可用,如未创建、或不是一个可用的套接字等。------源自MSDN