IRC“无识别响应”
我正在尝试用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您缺少 RFC 的部分内容。该请求确实看起来像“49764, 6667”,但您的响应需要更长一点:
不要忘记用 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:
Don't forget to terminate it with CRLF.