Haven’t looked through everything but try removing the line:
outputStream.WriteLine("USER " + userName + " 8 * :" + userName);
PASS(oauth) and NICK should be sufficient I believe.
Beyond that, set up a breakpoint then stepthrough each step to see where you get the error, that may help you see what exactly is throwing it.
Dallas is also correct, don’t see any spot where you read the PING and then call that function in your msg() function in Form1.cs