Make the address parameter of send() scoped.

This commit is contained in:
Sönke Ludwig 2017-01-22 03:05:46 +01:00
parent 17c4fe65a8
commit 1385250884
4 changed files with 4 additions and 4 deletions

View file

@ -99,7 +99,7 @@ interface EventDriverSockets {
bool setBroadcast(DatagramSocketFD socket, bool enable);
void receive(DatagramSocketFD socket, ubyte[] buffer, IOMode mode, DatagramIOCallback on_receive_finish);
void cancelReceive(DatagramSocketFD socket);
void send(DatagramSocketFD socket, const(ubyte)[] buffer, IOMode mode, Address target_address, DatagramIOCallback on_send_finish);
void send(DatagramSocketFD socket, const(ubyte)[] buffer, IOMode mode, scope Address target_address, DatagramIOCallback on_send_finish);
void cancelSend(DatagramSocketFD socket);
/** Increments the reference count of the given resource.

View file

@ -169,7 +169,7 @@ final class LibasyncEventDriverSockets : EventDriverSockets {
assert(false, "TODO!");
}
override void send(DatagramSocketFD socket, const(ubyte)[] buffer, IOMode mode, Address target_address, DatagramIOCallback on_send_finish)
override void send(DatagramSocketFD socket, const(ubyte)[] buffer, IOMode mode, scope Address target_address, DatagramIOCallback on_send_finish)
{
assert(false, "TODO!");
}

View file

@ -737,7 +737,7 @@ final class PosixEventDriverSockets(Loop : PosixEventLoop) : EventDriverSockets
() @trusted { return cast(DatagramIOCallback)slot.readCallback; } ()(socket, IOStatus.ok, ret, src_addrc);
}
void send(DatagramSocketFD socket, const(ubyte)[] buffer, IOMode mode, Address target_address, DatagramIOCallback on_send_finish)
void send(DatagramSocketFD socket, const(ubyte)[] buffer, IOMode mode, scope Address target_address, DatagramIOCallback on_send_finish)
{
assert(mode != IOMode.all, "Only IOMode.immediate and IOMode.once allowed for datagram sockets.");

View file

@ -321,7 +321,7 @@ final class WinAPIEventDriverSockets : EventDriverSockets {
assert(false, "TODO!");
}
override void send(DatagramSocketFD socket, const(ubyte)[] buffer, IOMode mode, Address target_address, DatagramIOCallback on_send_finish)
override void send(DatagramSocketFD socket, const(ubyte)[] buffer, IOMode mode, scope Address target_address, DatagramIOCallback on_send_finish)
{
assert(false, "TODO!");
}