提交 4d57c891 编写于 作者: X xuchi

客户端增加ipv6调整

上级 ea49c56d
......@@ -185,14 +185,28 @@ void WorkThread(Thread* pThread, int id)
Thread::Sleep(0);
}
if (Config::Instance().hasKey("-ipv6")) {
CELLLog_Info("using ipv6.");
}
else {
CELLLog_Info("using ipv4.");
}
for (int n = begin; n < end; ++n) // ++i效率更高比i++
{
if (!pThread->isRun())
break;
// 分析:数组元素访问越界,可能直接导致系统崩溃。
//if (INVALID_SOCKET == clients[n]->InitSocket(AF_INET, nSendBuffSize, nRecvBuffSize)) // 使用IPV4
if (INVALID_SOCKET == clients[n]->InitSocket(AF_INET6, nSendBuffSize, nRecvBuffSize)) // 使用IPV6
break;
if (Config::Instance().hasKey("-ipv6")) { // 通过配置实现:采用ipv4或ipv6
if (INVALID_SOCKET == clients[n]->InitSocket(AF_INET6, nSendBuffSize, nRecvBuffSize)) // 使用IPV6
break;
}
else {
if (INVALID_SOCKET == clients[n]->InitSocket(AF_INET, nSendBuffSize, nRecvBuffSize)) // 使用IPV4
break;
}
if (SOCKET_ERROR == clients[n]->Connect(strIP, nPort))
break;
nConnect++;
......
生成启动时间为 2023/3/12 23:23:39。
1>项目“E:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\EasyClient\EasyClient.vcxproj”在节点 2 上(Rebuild 个目标)。
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(388,5): warning MSB8028: The intermediate directory (E:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\\..\tmp\Debug\) contains files shared from another project (EasyServer.vcxproj). This can lead to incorrect clean and rebuild behavior.
1>ClCompile:
D:\software\VC\bin\CL.exe /c /I..\Depends\include /ZI /nologo /W3 /WX- /sdl- /Od /Oy- /D _MBCS /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo"E:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\\..\tmp\Debug\\" /Fd"E:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\\..\tmp\Debug\vc120.pdb" /Gd /TP /analyze- /errorReport:prompt client.cpp
client.cpp
1>e:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\depends\include\log.hpp(70): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\software\vc\include\time.inl(112) : 参见“localtime”的声明
1>e:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\depends\include\log.hpp(71): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\software\vc\include\stdio.h(356) : 参见“sprintf”的声明
1>e:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\depends\include\log.hpp(74): warning C4996: 'sprintf': This function or variable may be unsafe. Consider using sprintf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\software\vc\include\stdio.h(356) : 参见“sprintf”的声明
1>e:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\depends\include\log.hpp(78): warning C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\software\vc\include\stdio.h(211) : 参见“fopen”的声明
1>e:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\easyclient\client.cpp(118): warning C4800: “int”: 将值强制为布尔值“true”或“false”(性能警告)
1>e:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\easyclient\client.cpp(213): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\software\vc\include\string.h(112) : 参见“strcpy”的声明
1>e:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\easyclient\client.cpp(214): warning C4996: 'strcpy': This function or variable may be unsafe. Consider using strcpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\software\vc\include\string.h(112) : 参见“strcpy”的声明
1>e:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\easyclient\client.cpp(305): warning C4996: 'scanf': This function or variable may be unsafe. Consider using scanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\software\vc\include\stdio.h(283) : 参见“scanf”的声明
1>e:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\depends\include\log.hpp(197): warning C4996: 'localtime': This function or variable may be unsafe. Consider using localtime_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details.
d:\software\vc\include\time.inl(112) : 参见“localtime”的声明
e:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\depends\include\log.hpp(99): 参见对正在编译的函数 模板 实例化“void doyou::io::Log::EchoReal<const char*>(bool,const char *,const char *,const char *)”的引用
e:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\depends\include\log.hpp(91): 参见对正在编译的函数 模板 实例化“void doyou::io::Log::PError<const char*>(const char *,const char *)”的引用
Link:
D:\software\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:"E:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\\..\bin\Debug\EasyClient.exe" /INCREMENTAL /NOLOGO kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /manifest:embed /DEBUG /PDB:"E:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\\..\bin\Debug\EasyClient.pdb" /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:"E:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\\..\bin\Debug\EasyClient.lib" /MACHINE:X86 "E:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\\..\tmp\Debug\client.obj"
EasyClient.vcxproj -> E:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\\..\bin\Debug\EasyClient.exe
1>已完成生成项目“E:\files\技术doc\engine2.0\engine2.0\engine2.0\engine2.0\EasyClient\EasyClient.vcxproj”(Rebuild 个目标)的操作。
生成成功。
已用时间 00:00:01.27
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册