问题描述
亲爱的
我想问一下在无线网络中使用Winsock的功能吗?
即我可以使用Winsock在ad hoc网络中连接的两台计算机之间发送和接收帧吗?
非常感谢.
MSC.巴比伦大学学生suad alasasi,伊拉克,伊拉克
Dear
I would like to ask about the ability to use the winsock in wireless network?
i.e. Can i use the winsock to send and receive frame between two computer connecting in ad hoc network?
With my great thanks.
MSC. Student suad alasasi, babylon university, iraq
推荐答案
WSADATA wsaData;
// Initialize Winsock
int iResult = WSAStartup(MAKEWORD(2,2), &wsaData);
if (iResult != 0)
{
printf("WSAStartup failed: %d\n", iResult);
}
else
{
printf("WSAStartup OK\n");
}
之后,您可以调用connect
方法等.
Winsock入门 [ ^ ].
不要混淆自己,它可以通过Wi-Fi无线连接.
该链接是TCP或UDP连接上服务器和客户端的一个很好的例子.
http://www.tenouk.com/Winsock/Winsock2example9.html [ ^ ]
After this you can call connect
method etc.
There is a good Getting Started with Winsock[^].
Do not confuse your self that it is wireless via Wi-Fi.
This link a good example of server and client, both on TCP or UDP connection.
http://www.tenouk.com/Winsock/Winsock2example9.html[^]
这篇关于在无线网络中使用Winsock工具的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!