Merge pull request #136 from Yoplitein/tcpfunc

Fix #109 - TCPConnectionFunction is actually a delegate
merged-on-behalf-of: Sönke Ludwig <s-ludwig@users.noreply.github.com>
This commit is contained in:
The Dlang Bot 2019-02-24 12:36:29 +01:00 committed by GitHub
commit 61fcfb9847
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -145,12 +145,12 @@ TCPListener listenTCP(ushort port, void delegate(TCPConnection) connection_callb
This function is the same as listenTCP but takes a function callback instead of a delegate.
*/
TCPListener[] listenTCP_s(ushort port, TCPConnectionFunction connection_callback, TCPListenOptions options = TCPListenOptions.defaults)
TCPListener[] listenTCP_s(ushort port, TCPConnectionFunction connection_callback, TCPListenOptions options = TCPListenOptions.defaults) @trusted
{
return listenTCP(port, toDelegate(connection_callback), options);
}
/// ditto
TCPListener listenTCP_s(ushort port, TCPConnectionFunction connection_callback, string address, TCPListenOptions options = TCPListenOptions.defaults)
TCPListener listenTCP_s(ushort port, TCPConnectionFunction connection_callback, string address, TCPListenOptions options = TCPListenOptions.defaults) @trusted
{
return listenTCP(port, toDelegate(connection_callback), address, options);
}
@ -255,7 +255,7 @@ NetworkAddress anyAddress()
/// Callback invoked for incoming TCP connections.
@safe nothrow alias TCPConnectionDelegate = void delegate(TCPConnection stream);
/// ditto
@safe nothrow alias TCPConnectionFunction = void delegate(TCPConnection stream);
@safe nothrow alias TCPConnectionFunction = void function(TCPConnection stream);
/**