mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Server#close takes a callback function.
This commit is contained in:
parent
e79e2e64a6
commit
a4fcf4a0f2
2
socket.io/index.d.ts
vendored
2
socket.io/index.d.ts
vendored
@ -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();
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user