Tag: winsock

MinGW链接器错误:winsock

我在Windows上使用MinGW编译器来编译我的C ++应用程序与套接字。 我的连接命令如下所示: g++.exe -Wall -Wno-long-long -pedantic -lwsock32 -o dist/Windows/piskvorky { there are a lot of object files } 我也试过了 g++.exe -Wall -Wno-long-long -pedantic -lws2_32 -o dist/Windows/piskvorky { there are a lot of object files } 但在这两种情况下,我得到这个错误: build/Windows/MinGW-Windows/src/utils/tcpunit.o:tcpunit.cpp:(.text+0x33): undefined reference to `closesocket@4' build/Windows/MinGW-Windows/src/utils/tcpunit.o:tcpunit.cpp:(.text+0xd0): undefined reference to `send@16' build/Windows/MinGW-Windows/src/utils/tcpunit.o:tcpunit.cpp:(.text+0x1ee): undefined reference to `recv@16' build/Windows/MinGW-Windows/src/utils/tcpdevice.o:tcpdevice.cpp:(.text+0x184): undefined reference […]

如何支持IPv4和IPv6连接

我目前正在做一个UDP套接字应用程序,我需要build立支持,以便IPV4和IPV6连接可以发送数据包到服务器。 我希望有人能帮助我,指出我的方向是正确的。 我发现的大部分文档都不完整。 如果你能指出Winsock和BSD套接字之间的区别,那也是有帮助的。 提前致谢!

C ++ Winsock P2P

脚本 有没有人有使用Winsock的C ++中的对等(p2p)networking的好例子? 这是我对一个特别需要使用这种技术的客户的要求(上帝知道为什么)。 我需要确定这是否可行。 任何帮助将不胜感激。 编辑 我想避免使用库,以便我可以了解底层的源代码,并进一步了解我的知识。