Reputation: 531
My function which should join a channel doesn't get any response from the server. The weird thing that when I join a server I do get a response. but somehow, when I try to join a channel I don't receive any return.
private void join()
{
connection.Writer.Write("JOIN #" + ChannelName.Trim().ToLower() + "\r\n");
Console.WriteLine("JOIN #" + ChannelName.Trim().ToLower() + "\r\n");
connection.Writer.Flush();
//debug code
while (true)
{
while (connection.reader.Peek() >= 0)
{
String line = connection.reader.ReadLine();
if (line.Contains("PING :"))
{
connection.Writer.Write("PONG :" + line.Substring(line.IndexOf("PING :") + 6) + "\r\n");
connection.Writer.Flush();
}
Console.WriteLine(line);
}
}
}
Edit:
It seems that twitch doesn't do
"PING :"
but instead does
"PING "
weirdly changing only this doesn't seem to be fixing it. This is one of the moments where I would say. "My code is working and I don't know why."
Upvotes: 1
Views: 2040