Reputation: 15886
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.
Upvotes: 0
Views: 502
Reputation: 15886
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".
Upvotes: 0
Reputation: 5191
You can use Wireshark ( http://www.wireshark.org/ ) in order to check the raw data you send and receive. It has support for IRC protocol and it will help you a lot with debugging your client.
Upvotes: 3