IRC Connetivity in VB .NET

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

W13

Guest
Ive 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... Im 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 (thats 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, Ive 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

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

Can someone please help. :D

W13
 
Yes, youre missing loads of essential code. The commands youre sending the server arent 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 theyll just work, which isnt the case.

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