Send a line of text to the server, terminated by a carriage-return and linefeed.
A boolean value which specifies if the operation completed successfully. A return value of false indicates an error has occurred. To get extended error information, check the value of the LastError property.
The WriteLine method should only be used to send text, never binary data. In particular, this method will discard any data that follows a null character and will append linefeed and carriage return control characters to the data stream. Calling this method will force the current thread to block until the complete line of text has been written, the write operation times out or the remote host aborts the connection. If this method is called with the Blocking property set to false, it will automatically switch the client into a blocking mode, send the data and then restore the client to non-blocking mode. If another network operation is attempted while the WriteLine method is blocked sending data to the remote host, an error will occur. It is recommended that this method only be used with blocking connections.
The string will be converted to an array of bytes before being written to the socket. By default, the character encoding used will be for the current locale. Depending on the contents of the string, the number of bytes written may be different than the string length specified. This is because the conversion from Unicode to a byte array may result in a multi-byte character sequence.
You should never use strings to read and write binary data. Always use byte arrays to ensure that no character conversion is performed.
The Write and WriteLine methods can be safely intermixed.