Connection.sendline

Sends a line to the server.

Intended for servers that delimits lines by linebreaks, such as IRC servers.

class Connection
@system
void
sendline
(
const string rawline
,
const uint maxLineLength = 512
,
const string linebreak = "\r\n"
)

Parameters

rawline string

Line to send. May contain substrings separated by newline characters. A final linebreak is added to the end of the send.

maxLineLength uint

Maximum line length before the sent message will be truncated.

linebreak string

Characters to use as linebreak, marking the end of a line to send.

Throws

SocketSendException if the call to send data through the socket returns Socket.ERROR.

Examples

conn.sendline("NICK foobar");
conn.sendline("PRIVMSG #channel :text");
conn.sendline("PRIVMSG " ~ channel ~ " :" ~ content);
conn.sendline(longerLine, 1024L);  // Now with custom line lengths