mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-07 08:17:05 +00:00
Server#close takes a callback function.
This commit is contained in:
Vendored
+1
-1
@@ -180,7 +180,7 @@ declare namespace SocketIO {
|
||||
/**
|
||||
* Closes the server connection
|
||||
*/
|
||||
close():void;
|
||||
close( fn ?: () => void ):void;
|
||||
|
||||
/**
|
||||
* The event fired when we get a new connection
|
||||
|
||||
@@ -143,3 +143,14 @@ function testUsingItJustAsACrossBrowserWebSocket() {
|
||||
socket.on('disconnect', function () { });
|
||||
});
|
||||
}
|
||||
|
||||
function testClosingServerWithCallback() {
|
||||
var io = socketIO.listen(80);
|
||||
io.close(function() {
|
||||
});
|
||||
}
|
||||
|
||||
function testClosingServerWithoutCallback() {
|
||||
var io = socketIO.listen(80);
|
||||
io.close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user