IRC Connetivity in VB .NET

  • Thread starter Thread starter W13
  • Start date Start date
W

W13

Guest
I've been fiddling around with VB.net and for the past week trying to figure out how to write a very very simple IRC client - unfortunately the new microsoft sockets stuff is far too confusing for me.

So can anyone PLEASE tell me how to connect-to and send-messages-to and read-messages-from an IRC server.

So basically I want a VERY VERY VERY simple IRC client - from then on, I can build upon it. I just dont know how to connect to, send messages to, and read messages from IRC. (using vb .net)

W13

:D
 
Perfect timing... I'm working on a VB.NET IRC bot as I type this.
Assuming you already know the simple parts of the IRC protocol,
you should download 101 VB.NET examples. There is an example
for using the sockets namespace to send and receive data
between a client a server. It will help you understand how
asynchronous sockets work, and you can even use the sockets
code from the client in your IRC client (that's what I did, with some
changes of course.)

Good luck.
 
Thanks a lot - but I am still unable to simplify that code - it is several pages long and I have no idea whats going on.

Until now, I've sort of put together this much:

Code:
Imports System.Net.Sockets
Imports System.Text

Public Class frmMain
    Inherits System.Windows.Forms.Form
    Private client As TcpClient

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

        client = New TcpClient("irc.jurai.org", 6667)

    End Sub

    Private Sub cmdConnect_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdConnect.Click
        SendData("/nick Zombee")
        SendData("/join #zombee")
    End Sub

    Private Sub SendData(ByVal data As String)
        Dim writer As New IO.StreamWriter(client.GetStream)
        writer.Write(data & vbCr)
        writer.Flush()
    End Sub

End Class

I'm pretty sure I'm missing loads of essential code but I really cant tell. From the one I have put together (which doesn't work btw), I understand about 1% of! lol.

Can someone please help. :D

W13
 
Yes, you're missing loads of essential code. The commands you're sending the server aren't part of the IRC protocol. You are under the impression that you send the IRC server the same commands that you type in to your IRC client and they'll just work, which isn't the case.

You need to read RFC 1459 and make sure you understand it, then learn asynchronous sockets. Aside from answering specific questions, it's out of the scope of this forum to teach you how to do that.
 
Back
Top