Added EventDriverSockets.setKeepAlive.
This commit is contained in:
parent
2341762992
commit
d8f10972eb
|
@ -84,6 +84,7 @@ interface EventDriverSockets {
|
||||||
void waitForConnections(StreamListenSocketFD sock, AcceptCallback on_accept);
|
void waitForConnections(StreamListenSocketFD sock, AcceptCallback on_accept);
|
||||||
ConnectionState getConnectionState(StreamSocketFD sock);
|
ConnectionState getConnectionState(StreamSocketFD sock);
|
||||||
void setTCPNoDelay(StreamSocketFD socket, bool enable);
|
void setTCPNoDelay(StreamSocketFD socket, bool enable);
|
||||||
|
void setKeepAlive(StreamSocketFD socket, bool enable);
|
||||||
void read(StreamSocketFD socket, ubyte[] buffer, IOMode mode, IOCallback on_read_finish);
|
void read(StreamSocketFD socket, ubyte[] buffer, IOMode mode, IOCallback on_read_finish);
|
||||||
void cancelRead(StreamSocketFD socket);
|
void cancelRead(StreamSocketFD socket);
|
||||||
void write(StreamSocketFD socket, const(ubyte)[] buffer, IOMode mode, IOCallback on_write_finish);
|
void write(StreamSocketFD socket, const(ubyte)[] buffer, IOMode mode, IOCallback on_write_finish);
|
||||||
|
|
|
@ -104,6 +104,11 @@ final class LibasyncEventDriverSockets : EventDriverSockets {
|
||||||
assert(false, "TODO!");
|
assert(false, "TODO!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override void setKeepAlive(StreamSocketFD socket, bool enable)
|
||||||
|
{
|
||||||
|
assert(false, "TODO!");
|
||||||
|
}
|
||||||
|
|
||||||
override void read(StreamSocketFD socket, ubyte[] buffer, IOMode mode, IOCallback on_read_finish)
|
override void read(StreamSocketFD socket, ubyte[] buffer, IOMode mode, IOCallback on_read_finish)
|
||||||
{
|
{
|
||||||
assert(false, "TODO!");
|
assert(false, "TODO!");
|
||||||
|
|
|
@ -350,6 +350,12 @@ final class PosixEventDriverSockets(Loop : PosixEventLoop) : EventDriverSockets
|
||||||
() @trusted { setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, cast(char*)&opt, opt.sizeof); } ();
|
() @trusted { setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, cast(char*)&opt, opt.sizeof); } ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
final override void setKeepAlive(StreamSocketFD socket, bool enable)
|
||||||
|
{
|
||||||
|
ubyte opt = enable;
|
||||||
|
() @trusted { setsockopt(socket, SOL_SOCKET, SO_KEEPALIVE, cast(char*)&opt, opt.sizeof); } ();
|
||||||
|
}
|
||||||
|
|
||||||
final override void read(StreamSocketFD socket, ubyte[] buffer, IOMode mode, IOCallback on_read_finish)
|
final override void read(StreamSocketFD socket, ubyte[] buffer, IOMode mode, IOCallback on_read_finish)
|
||||||
{
|
{
|
||||||
if (buffer.length == 0) {
|
if (buffer.length == 0) {
|
||||||
|
|
|
@ -111,6 +111,11 @@ final class WinAPIEventDriverSockets : EventDriverSockets {
|
||||||
assert(false, "TODO!");
|
assert(false, "TODO!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override void setKeepAlive(StreamSocketFD socket, bool enable)
|
||||||
|
{
|
||||||
|
assert(false, "TODO!");
|
||||||
|
}
|
||||||
|
|
||||||
override void read(StreamSocketFD socket, ubyte[] buffer, IOMode mode, IOCallback on_read_finish)
|
override void read(StreamSocketFD socket, ubyte[] buffer, IOMode mode, IOCallback on_read_finish)
|
||||||
{
|
{
|
||||||
assert(false, "TODO!");
|
assert(false, "TODO!");
|
||||||
|
|
Loading…
Reference in a new issue