“通知授权”连接到 IRC 服务器时的通知
作为学习练习,我正在编写一个 Python 程序来连接到 IRC 网络上的通道,以便我可以将通道中的消息输出到 stdout。我使用异步聊天并手动发送协议消息,而不是使用 Twisted 或来自网络的现有机器人代码 - 同样,这是一种更有用的学习体验。
我可以非常愉快地发送 JOIN 和 USER 命令,并且可以根据需要 PING/PONG 离开。但是,我注意到当打开端口 6667 的套接字时,我会收到一些消息:
NOTICE AUTH :*** Looking up your hostname...
NOTICE AUTH :*** Checking ident
NOTICE AUTH :*** Found your hostname
NOTICE AUTH :*** No identd (auth) response
即使我尚未发送 JOIN/USER 命令。
那么,这个通知的打开顺序是否在任何地方指定了?据我所知,RFC 没有指定在客户端发送 JOIN 命令之前发生的任何特定情况,并且我不确定是否要在发送 JOIN 命令之前等待收到这些通知,如果是的话如何检测我是否已收到所有通知?
As a learning exercise, I'm writing a Python program to connect to a channel on an IRC network, so I can output messages in the channel to stdout. I'm using asynchat and manually sending the protocol messages, rather than using something like Twisted or existing bot code from the net - again, it's a more useful learning experience that way.
I can send JOIN and USER commands quite happily, and can PING/PONG away as required. However, I've noticed when opening a socket to port 6667, I'll receive some messages:
NOTICE AUTH :*** Looking up your hostname...
NOTICE AUTH :*** Checking ident
NOTICE AUTH :*** Found your hostname
NOTICE AUTH :*** No identd (auth) response
even if I've not yet sent the JOIN/USER commands.
So, is this opening sequence of notifications specified anywhere? As far as I can see, the RFC doesn't specify for anything in particular to happen before the client sends the JOIN command, and I wasn't sure whether to wait for receipt of these notices before sending the JOIN command, and if so how do I detect that I've received all of the notices?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RFC 没有要求这样做,这只是野外服务器所做的常见事情。请注意,它们是普通的旧 NOTICE 命令(即只是消息)。只需将它们视为发送给伪用户“AUTH”的消息(因为服务器还没有更好的名称)。您不需要等待它们,服务器也不需要发送它们。
There's no RFC requirement to do this, it's just a common thing that servers in the wild do. Observe that they're plain old NOTICE commands (i.e. just messages). Just treat them as messages sent to a psuedo-user "AUTH" (since the server doesn't have a better name for you yet). You're not required to wait for them, and the server is not required to send them.