Socket.OutputStream isn't working properly
===

I had a problem a few days ago with [Sockets in WinRT](http://stackoverflow.com/questions/11306314/networkstream-equivelant). The solution worked fine (as I was able to receive responses), but then something was going wrong with the OutputStream. Since my packet structure of the application I'm developing is close to IRC, I started to create an IRC application so I could test it with accuracy. It works almost, except the packets aren't sent properly (according to http://forums.xkcd.com/viewtopic.php?f=11&t=61777) and hopefully I could get some more help as it's really confusing.

My code:

            try
            {
                // Connect to the server (in our case the listener we created in previous step).
                await Socket.ConnectAsync(new HostName(Config.Server), Config.Port.ToString());
            }
            catch (Exception exception)
            {
                // If this is an unknown status it means that the error is fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                ServerPage.LoggedRawText("Unable to connect...");
                selectedItem.Description = "Unable to connect";
            }

            // Create a DataWriter if we did not create one yet. Otherwise use one that is already cached.
            Writer = new DataWriter(Socket.OutputStream);
            Listener = new DataReader(Socket.InputStream);

            string Line = "";
            Connected = true;
            Listener.InputStreamOptions = InputStreamOptions.Partial;

            SendRaw("NICK", new string[1] { Config.Nickname });
            SendRaw("USER", new string[4] { Config.Nickname, "*", "*", ":" + Config.RealName });

            ServerPage.LoggedRawText("Established a connection");
            selectedItem.Description = "Established a connection";

            while (Connected)
            {
                await Listener.LoadAsync(2); //Should be larger but for now put it small so I can analyze easily as ping isn't coming through
                if (Listener.UnconsumedBufferLength != 0)
                {
                    if ((Line += Listener.ReadString(Listener.UnconsumedBufferLength)) != null)
                    {
                        if (Line.Contains(Environment.NewLine))
                        {
                            string[] SplittedLine = Line.Split(Environment.NewLine.ToCharArray());
                            ServerPage.LoggedRawText(Line.Replace(Environment.NewLine, ""));
                            selectedItem.Description += Line.Replace(Environment.NewLine, "");

                            //Handle any left over buffer
                            #region Extra buffer
                            if (SplittedLine.Length > 1)
                            {
                                string[] newSplittedLine = new string[SplittedLine.Length - 2];
                                int c = 0;
                                foreach (string str in SplittedLine)
                                {
                                    if (c != 0)
                                    {
                                        newSplittedLine[c] = SplittedLine[c];
                                        c++;
                                    }
                                }
                                Line = String.Join(Environment.NewLine, newSplittedLine);
                            }
                            else
                            {
                                Line = "";
                            }
                            #endregion
                        }
                    }
                }
            }
        }

        async public void SendRaw(string str, string[] args)
        {
            if (args != null)
                Writer.WriteString(str + " " + String.Join(" ", args));
            else
                Writer.WriteString(str);

            // Write the locally buffered data to the network.
            try
            {
                await Writer.StoreAsync();
            }
            catch (Exception exception)
            {
                // If this is an unknown status it means that the error if fatal and retry will likely fail.
                if (SocketError.GetStatus(exception.HResult) == SocketErrorStatus.Unknown)
                {
                    throw;
                }

                Debug.WriteLine("Failed to send packet " + str);
                ServerPage.LoggedRawText("Failed to send packet " + str);
                selectedItem.Description += "Failed to send packet " + str;
            }
        }

That isn't working properly. I get this as a result: http://i.imgur.com/AEyhr.png

Note that I don't recieve the PING response

I looked it up and saw the xkcd thread (as listed above) and saw that my responses aren't getting through, but they are (ignore the IP error, its Windows 8 messing with wireshark's checksum): http://i.imgur.com/1W2eP.png

I tried esper.net and freenode, and they both do the same thing. I tried a C# 4.0 client that I created and it works fine... any help, please?