VB6/IRC PING 和乒乓球问题

发布于 2024-09-08 20:06:55 字数 452 浏览 4 评论 0原文

我无法将 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 技术交流群。

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

发布评论

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

评论(1

木槿暧夏七纪年 2024-09-15 20:06:55

RFC2812 中的 IRC 协议防御再次有所帮助: https://www.rfc-editor.org/ rfc/rfc2812

来自服务器的 PING 命令看起来像这样:

PING :3213546231

该命令的正确答案是:

PONG :3213546231

使用与 PING 一起发送的相同标识符。

/^PING :(.+)/   -->  respond with "PONG :$1"

错误消息指出,您没有以符合要求的方式连接服务器。建立 TCP 套接字后,您必须发送以下命令:

NICK <yourNickName>
USER <yourUserName> 32 . :<yourRealName>

然后您将收到 MOTD。此后将开始“PING - PONG”游戏,以确保您的连接仍然有效。

或者您正在连接需要身份验证的服务器:

如果是这样,您必须发送命令:

PASS <yourpassword>

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:

PING :3213546231

The correct answer on this command is:

PONG :3213546231

using the same identifier, which was send with the PING.

/^PING :(.+)/   -->  respond with "PONG :$1"

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:

NICK <yourNickName>
USER <yourUserName> 32 . :<yourRealName>

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:

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