connections

WebJar for connections

License

License

BSD 2-Clause
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

connections
Last Version

Last Version

1.4.2
Release Date

Release Date

Type

Type

jar
Description

Description

connections
WebJar for connections
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/maxogden/connections

Download connections

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/connections/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>connections</artifactId>
    <version>1.4.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/connections/
implementation 'org.webjars.npm:connections:1.4.2'
// https://jarcasting.com/artifacts/org.webjars.npm/connections/
implementation ("org.webjars.npm:connections:1.4.2")
'org.webjars.npm:connections:jar:1.4.2'
<dependency org="org.webjars.npm" name="connections" rev="1.4.2">
  <artifact name="connections" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='connections', version='1.4.2')
)
libraryDependencies += "org.webjars.npm" % "connections" % "1.4.2"
[org.webjars.npm/connections "1.4.2"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

connections

Keeps track of connections to an http or tcp server (or any other server object with the same api) and provides a way to close connections

By default, require('http').createServer provides no mechanism for tracking client connections and/or closing client connections

NPM

usage

var connections = require('connections')(serverInstance)

You can also pass an array of server instances

connections has .sockets and .destroy

connections.on('idle', function() {})

called whenever all active connections have closed

connections.on('close', function(socket) {})

called whenever a socket closes

connections.on('connection', function (socket) {})

forwarded event from the server or servers

connections.sockets

an array of open sockets (http clients)

connections.destroy()

destroys/closes all active connections (calls .destroy() on each socket)

connections.add(socket)

manually add a socket to the connection list

Versions

Version
1.4.2