Splat: the socket platform with the lame name. It's full of puns, but it runs!
Download Splat.
Version 0.7.
For both Phobos and Tango; tested with Phobos and Tango 0.99.2.
void run();
Run the event loop; wait for timer and socket events.
Exceptions that occur in event callbacks break out of run.
void exitLoop();
Causes run() to return as soon as it can.
class Timer;
Timers; alarms (timeout events) depend on run().
final void interval(uint iv);
final uint interval();
Property:
get and set the timer interval in milliseconds.
final void start();
Start this timer.
final void stop();
Stop this timer.
void onAlarm();
Override to be notified when the time expires. Alarms continue until stop().
this();
this(void delegate(Timer) dg);
Construct a timer; can take a delegate that is called back automatically on an alarm.
enum EventType;
Socket event flags.
NONE
READ WRITE ACCEPT CONNECT CLOSE
alias RegisterEventCallback;
Callback type for socket events.
Params:
sock
the socket
type
which event; will be only one of the event flags.
err
an error code, or 0 if successful.
class AsyncSocket: std.socket.Socket;
Asynchronous sockets; socket events depend on run(). Mostly the same as std.socket.Socket.
Registers a callback for specified socket events.
One or more type flags may be used, or NONE to cancel all.
Calling this twice on the same socket cancels out previously registered events for the socket.