Dirk



class  DccException: object.Exception;

Thrown when a DCC error occurs.


class  DccServer;

Hub for new DCC connections.


this(IrcEventLoop eventLoop, IrcClient client);

Create a new DCC server given the event loop and IRC client to be associated with this server.

The event loop is used to schedule reads and writes for open DCC connections.

The associated IRC client is used to send DCC/CTCP notifications as well as to look up the Internet address to advertise for this server.


const pure @property uint  clientAddress();
pure @property void  clientAddress(uint addr);
@property void  clientAddress(in char[] hostName);
@property void  clientAddress(Address address);

The IP address of the DCC server in network byte order.

If not explicitly provided, this defaults to the result of looking up the hostname for the associated IRC client.


void  setPortRange(ushort lower, ushort upper);

Set the port range for accepting connections.

The server selects a port in this range when initiating connections. The default range is 49152–65535. The range is inclusive on both ends.


DccChat  inviteChat(in char[] nick, uint timeout = 10);

Invite the given user to a DCC chat session.

The associated IRC client must be connected.

Parameters
char[] nick nick of user to invite
uint timeout time in seconds to wait for the invitation to be accepted
Returns
A listening DCC chat session object

abstract class  DccConnection;

Represents a DCC connection.


enum  State: int;
State  state;

Current  state of the connection.


This session is waiting for a connection.


This session timed out when waiting for a connection.


This is an active connection.


This DCC session has ended.


protected this(Socket socket, uint timeout, State initialState);

Initialize a DCC resource with the given socket, timeout value and state.


protected final void  write(in void[] data);

Write to this connection.


protected abstract void  onConnected();

Invoked when the connection has been established.


protected abstract void  onDisconnected();

Invoked when the connection was closed cleanly.


protected abstract bool  onRead(in void[] data);

Invoked when data was received.


immutable uint  timeout;

The timeout value of this connection in seconds.


abstract @property string  name();

Name of this resource.


void delegate(Exception e)[]  onError;

Invoked when an error occurs.


void delegate()[]  onTimeout;

Invoked when a listening connection has timed out.


class  DccChat: irc.dcc.DccConnection;

Represents a DCC chat session.


@property string  name();

Always the string "chat".


void delegate()[]  onConnect;

Invoked when the session has started.


void delegate()[]  onFinish;

Invoked when the session has cleanly ended.


void delegate(in char[] line)[]  onMessage;

Invoked when a line of text has been received.


void  send(in char[] message);

Send a single chat message.

Parameters
char[] message message to send. Must not contain newlines.

void  sendf(FmtArgs...)(in char[] fmt, FmtArgs fmtArgs);

Send a single, formatted chat message.

Parameters
char[] fmt format of message to send. Must not contain newlines.
FmtArgs fmtArgs fmt is formatted with these arguments.
See Also
std.format.formattedWrite

void  sendMultiple(in char[] messages);

Send chat messages. Each message must be terminated with the character \n.


void  finish();

End the chat session.