
Company News
Socket Named Top Sales Organization by RepVue
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.
have a server and a client ping/pong each other
the server and client are symmetrical. first the client pings the server, then the server pings the client. this means both can measure keep the connection alive, and clock skew correctly, which is sure to be useful at some point.
var ping = require('pull-ping-pong')
var toPull = require('stream-to-pull-stream')
net.createServer(function (stream) {
stream = toPull.duplex(stream)
pull(
stream,
ping({timeout: 10e3}), //ping every 10 seconds
stream
)
}).listen(1234, function () {
var stream = toPull.duplex(net.connect(1234))
pull(
stream,
//ping every 10 seconds, set 'serve' to true to begin the ping.
ping({timeout: 10e3, serve: true}),
stream
)
setInterval(function () {
//check rtt and skew to get statistics about the connection
console.log(stream.rtt.mean, stream.skew.mean)
}, 1000)
})
timeout is the number of milliseconds. the default is 5 minutes,
although the first ping will happen immediately.
set serve to true on one side of connection, this starts the ping pong.
"serve" is ment in the (table) tennis sense, I set it on the client.
Statistics on the round trip time and clock skew will be set on the stream object. These are instances of statistics
MIT
FAQs
measure latency/rtt and clock skew with pull-streams
We found that pull-ping demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.

Company News
/Security News
Socket is an initial recipient of OpenAI's Cybersecurity Grant Program, which commits $10M in API credits to defenders securing open source software.