IRC“无识别响应”

发布于 2024-11-25 02:09:16 字数 634 浏览 1 评论 0原文

我正在尝试用 Python 制作 IRC 客户端,但遇到了 Ident 问题。
我在端口 113 上侦听来自 Ident 服务器的消息,这有效。该消息如下所示: 49764 , 6667。
但是,当我发回消息时,我收到“无识别响应”(该消息看起来像 RFC)。我尝试过的任何方法都不起作用(发送回我收到消息的IP和端口,将其发送到irc.freenode.net(我也在连接的服务器),也没有将其发送到我收到消息的IP和我从 (49764) 收到消息的端口有效,并且 RFC 无法帮助我将响应发送到哪里。

lsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
lsock.bind(("",113))
lsock.listen(5)
conn, addr = lsock.accept() #Conn = Connection to addr, addr = address and port that is connecting to me
msg = conn.recv(1024)
print msg #This is where I got 47964 , 6667

I am trying to make a IRC client in Python and I got a problem with Ident.
I listen on port 113 for message from the Ident server, this works. The message looks like this: 49764 , 6667.
But when I am sending the message back I get "No Ident response" (The message looks like the message in the RFC). Nothing that I tried has been working (Sending back to the IP and port that I got the message from, sending it to irc.freenode.net (The server I am connecting too) nor sending it to the IP I got the message from and the port I got the message from (49764) works. And the RFC doesn't help me where to send the response to.

lsock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
lsock.bind(("",113))
lsock.listen(5)
conn, addr = lsock.accept() #Conn = Connection to addr, addr = address and port that is connecting to me
msg = conn.recv(1024)
print msg #This is where I got 47964 , 6667

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

胡渣熟男 2024-12-02 02:09:16

您缺少 RFC 的部分内容。该请求确实看起来像“49764, 6667”,但您的响应需要更长一点:

49764,6667:USERID:UNIX:Nicklas

不要忘记用 CRLF 终止它。

You are missing parts of the RFC. The request does indeed look like "49764, 6667", but your response need to be a little longer:

49764,6667:USERID:UNIX:Nicklas

Don't forget to terminate it with CRLF.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文