所以,我正在制作一个机器人来监控我的 IRC 频道,但我无法让它注册 ident,我不知道为什么,这是我的代码
int count = 0;
int BeginReceive() {
do {
initResult = recv(bobSocket, recvbuf, recvbuflen, 0);
if (initResult > 0) {
printf(recvbuf);
count++;
std::cout << count << std::endl;
switch (count) {
case 2:
Send("USER jackolalno :hello");
Send("NICK jackololno");
break;
case 3:
Send("JOIN ##bob");
default:
break;
}
}
else if (initResult == 0) {
printf("Connection closed\n");
}
else {
printf("recv failed: %d\n", WSAGetLastError());
return 1;
}
} while (initResult > 0);
}