如何在WinCE5中使用原始套接字?
我需要在 Windows CE 5.0 中使用原始套接字。以下代码总是失败,并出现错误
socket failed, err:10044
。
(此地址族中不存在对指定套接字类型的支持。)
WSAData wsaData;
SOCKET s;
int n;
n = WSAStartup(MAKEWORD(2,0), &wsaData);
if (n < 0) {
printf("WSAStartUp failed, err:%d\n", WSAGetLastError());
} else {
s = socket(AF_INET, SOCK_RAW, IPPROTO_IP);
if (s < 0)
{
printf("socket failed, err:%d\n", WSAGetLastError());
}
}
在视窗CE?
I need to use raw sockets in Windows CE 5.0. The following code always fails with error
socket failed, err:10044
.
(The support for the specified socket type does not exist in this address family.)
WSAData wsaData;
SOCKET s;
int n;
n = WSAStartup(MAKEWORD(2,0), &wsaData);
if (n < 0) {
printf("WSAStartUp failed, err:%d\n", WSAGetLastError());
} else {
s = socket(AF_INET, SOCK_RAW, IPPROTO_IP);
if (s < 0)
{
printf("socket failed, err:%d\n", WSAGetLastError());
}
}
What must I do for using raw sockets in Windows CE?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现针对 WinCE 特定套接字的 MSDN 文档相当少,但是 桌面 Winsock 指南< /a> 相当不错。
当我尝试为 WinCE 5.0 编写第一个套接字应用程序时,我偶然发现了以下链接:
我希望你发现它们有用。
请注意,尽管上述文章适用于桌面,但我只需稍作修改即可使用这些概念和代码。
I find MSDN documentations for WinCE specific sockets are rather few, but the guide for desktop winsock is pretty nice.
I stumbled upon the following links when trying to write my very first socket app for WinCE 5.0:
I hope you find them useful.
Note that even though the above articles are for desktop, I can use the concepts and codes with few modifications.
Windows CE 5.0 不支持原始 IP 套接字。
您可以使用 NDISUIO 发送任意内容的数据包。
Raw IP sockets are not supported in Windows CE 5.0.
You can use NDISUIO to send packets with arbitrary content.