@sz-md/node-reconnecting-tcp-socket
v0.5.0
Published
A reconnecting TCP socket module:
Downloads
2
Readme
@sz-md/node-reconnecting-tcp-socket
A reconnecting TCP socket module:
const socket = await NodeReconnectingTCPSocket.create({
host: "localhost",
port: 1337
})
socket.on("connected", () => {
console.log("Socket connected.")
socket.write("Hallo!\n")
})
socket.on("disconnected", () => {
console.log("Socket disconnected.")
})
socket.on("data", (data) => {
console.log("Received", data.toString())
})