Hello, I am writing an IRC client , to communicate with the internal IRC server of the twitch and I encountered the following problem: the request to the server does not work with a multi-line message (command list), because StreamWriter, when using the Flush () method, sends the Tcp data to the client without a packet, and in pieces OR tcpClient itself sends a request in pieces, not the essence. In general, the request is divided into pieces: (. As a result, in the case of line-by-line writing of the list of commands to the stream, the message is not displayed at all.
Tried to send a request with a message in one line with "\ n" in the right places - it cuts off everything after the first line of the command (displays the first line of the list of commands in the chat)
Question : Is it possible to send a request with a multi-line message to the irc server or not? If so, how? I attach the code:
public void sendChatMessage(string message) { sendIrcMessage(":" + userName + "!" + userName + "@" + userName + "twi.twitch.tv PRIVMSG #" + channel + " :@" + senderName + " " + message); } public void sendChatBroadcastChatMessage(string message) { sendIrcMessage(":" + userName + "!" + userName + "@" + userName + "twi.twitch.tv PRIVMSG #" + channel + " : " + message); } public void sendChatBroadcastChatMessage(List<string> messages) { messages.Insert(0, ":" + userName + "!" + userName + "@" + userName + "twi.twitch.tv PRIVMSG #" + channel + " : "); sendIrcMessage(messages); } userName - bot name, channel - channel name
private void sendIrcMessage(List<string> messages) { try { if (outputStream == null) throw new Exception("Output stream is empty..."); foreach (var item in messages) { outputStream.WriteLine(item); } outputStream.Flush(); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.ReadLine(); return; } } messages in this case is a list of commands:
"!hi - приветствие", "!date - дата и время сервера", "!commands - список команд" So, sendChatBroadcastChatMessage (messages) is called. In it, a request is added to the beginning of the message and the sendIrcMessage (messages) method is called with the updated list. I hope I told you in enough detail
Server response:

