VB6/IRC PING 和乒乓球问题
我无法将 PING 返回到 IRC,这会发回“您必须先注册”错误,这是我正在使用的代码:
Private Sub wsConnect_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
wsConnect.GetData strData
If InStr(strData, "PING") <> 0 Then
MsgBox ("Success!") 'Check it's receiving it.
wsConnect.SendData Replace(strData, "PING", "PONG") & vbCrLf
End If
Me.txtDataIn.Text = Me.txtDataIn.Text & strData
End Sub
有帮助吗?
I am not able to PONG back the PING to IRC, which sends back a "You must register first" error, here is the code I'm using:
Private Sub wsConnect_DataArrival(ByVal bytesTotal As Long)
Dim strData As String
wsConnect.GetData strData
If InStr(strData, "PING") <> 0 Then
MsgBox ("Success!") 'Check it's receiving it.
wsConnect.SendData Replace(strData, "PING", "PONG") & vbCrLf
End If
Me.txtDataIn.Text = Me.txtDataIn.Text & strData
End Sub
Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
RFC2812 中的 IRC 协议防御再次有所帮助: https://www.rfc-editor.org/ rfc/rfc2812
来自服务器的 PING 命令看起来像这样:
该命令的正确答案是:
使用与 PING 一起发送的相同标识符。
错误消息指出,您没有以符合要求的方式连接服务器。建立 TCP 套接字后,您必须发送以下命令:
然后您将收到 MOTD。此后将开始“PING - PONG”游戏,以确保您的连接仍然有效。
或者您正在连接需要身份验证的服务器:
如果是这样,您必须发送命令:
Again the IRC-protocol defenition in RFC2812 helps: https://www.rfc-editor.org/rfc/rfc2812
The PING-command from the server looks something like this:
The correct answer on this command is:
using the same identifier, which was send with the PING.
The error-message points out, that you did not connect the server in a conform way. After establishing the TCP-socket, you have to send the following commands:
Then you will receive the MOTD. The "PING - PONG" play will begin after this, to make sure your connection is still alive.
Or you are connecting a server that needs authentication:
If so, you have to send the command: