描述
我为立方体 2 制作了一个 C 服务器模块:Sauerbraten https://github.com/deathstar/QServCollect
所有代码都可以在上面的链接中找到
IRC Bot 最终停止在打开的套接字上发送 ping/pong 数据。该进程是线程化的,由于主线程是通过 PTHREAD_CREATE_JOINABLE 加入的,因此当 IRC bot 死亡时,它就会死亡。这会导致整个服务器崩溃,我只是想调试它。任何帮助,将不胜感激。
钥匙
Ircbot 代码:ircbot/ircbot.cpp、ircbot/ircbot.h
主线程:engine/server.cpp
LLDB 调试报告
Process 7933 stopped
* thread #1: tid = 0xa4b8d, 0x00007fff83e4010a libsystem_kernel.dylib`__semwait_signal + 10, queue = 'com.apple.main-thread', stop reason = signal SIGPIPE
frame #0: 0x00007fff83e4010a libsystem_kernel.dylib`__semwait_signal + 10
libsystem_kernel.dylib`__semwait_signal:
-> 0x7fff83e4010a <+10>: jae 0x7fff83e40114 ; <+20>
0x7fff83e4010c <+12>: movq %rax, %rdi
0x7fff83e4010f <+15>: jmp 0x7fff83e3a7f2 ; cerror
0x7fff83e40114 <+20>: retq
服务器日志
PING :NuclearFallout.WA.US.GameSurge.net
SENT: PONG :NuclearFallout.WA.US.GameSurge.net
PING :NuclearFallout.WA.US.GameSurge.net
SENT: PONG :NuclearFallout.WA.US.GameSurge.net
[ OK ] looking up sauerbraten.org...
master server registration failed: failed pinging server
[ OK ] looking up sauerbraten.org...