src/HarmonyHub/Client.cs
/// <summary>
/// Sends the specified string to the server.
/// </summary>
/// <remarks>
/// Do not use this method directly except for stream initialization and closing.
/// </remarks>
/// <param name="xml">The string to send.</param>
/// <exception cref="ArgumentNullException">The xml parameter is null.</exception>
/// <exception cref="IOException">There was a failure while writing to the network.</exception>
Sends the specified string to the server.
Sends the specified string to the server .
private void Send(string xml)
        {
            if (xml == null)
                throw new ArgumentNullException("xml");
            byte[] buf = Encoding.UTF8.GetBytes(xml);
            lock (_writeLock)
            {
                try
                {
                    _stream.Write(buf, 0, buf.Length);
                    _messageId++;
                    MessageSent?.Invoke(this, new MessageSentEventArgs(xml));
                }
                catch
                {
                    Authenticated = false;
                    Connected = false;
                    throw;
                }
            }
        }
private void Send ( string xml ) { if ( xml == null ) throw new ArgumentNullException ( " " ) ; byte [ ] buf = Encoding . UTF8 . GetBytes ( xml ) ; lock ( _writeLock ) { try { _stream . Write ( buf , 0 , buf . Length ) ; _messageId ++ ; MessageSent ? . Invoke ( this , new MessageSentEventArgs ( xml ) ) ; } catch { Authenticated = false ; Connected = false ; throw ; } } }
Sends the specified string to the server.
Sends the specified string to the server .
// XMPP is guaranteed to be UTF-8.
The xml parameter is null.
The xml parameter is null .
There was a failure while writing to the network.
There was a failure while writing to the network .
xml
string
The string to send.
The string to send .
remarks
Do not use this method directly except for stream initialization and closing.
Do not use this method directly except for stream initialization and closing .