Search code examples
c#.netclientirc

C# IRC client not sending data (it seems)


A friend and I are working on an IRC client in C#, just for practice.

We've implemented it so that it listens for data all the time on a separate thread, even though I don't believe that this should interfere in any way.

We have a IRCClient class that uses the following Send method, which, apparently doesn't work.

public void Send(string command)
{
    NetworkStream stream = this.client.GetStream();
    StreamWriter writer = new StreamWriter(stream);

    writer.Write(command + "\r\n");
    writer.Flush();
}

The "client" attribute is a TcpClient that is properly connected to the IRC server. And yes, we can receive data.


Solution

  • I figured out that the IRC client (in order to send commands) must exclude the preceding slash "/". So instead of "/say hello", you just have to send "SAY hello".