I’m confused why you’re sending a PING message to twitch since those should only ever be received by a client, not sent. However your response message looks like it’s formatted correctly. I would check to make sure that StreamWriter properly appends \r\n since any other combination violates the IRC spec and might be seen as a garbage message. Are you able to successfully send other messages with your SendIrcMessage(...) function?
For reference, this is my writer which works as of last night. (Also in C#)
public void
Pong(string trailing = "")
{
string message = "PONG";
if (trailing.IsValid())
{
message += " :" + trailing;
}
Send(message);
}
public void
Send(string format, params object[] arguments)
{
ExceptionUtil.ThrowIfInvalid(format, nameof(format));
string message = !arguments.IsValid() ? format : string.Format(format, arguments);
if (!CanSend(message))
{
return;
}
byte[] bytes = Encoding.UTF8.GetBytes(message + "\r\n");
stream.Write(bytes, 0, bytes.Length);
stream.Flush();
OnDataSent.Raise(this, new DataEventArgs(bytes, message));
}