Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@kalm/udp

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kalm/udp - npm Package Compare versions

Comparing version 3.2.2 to 3.2.3

2

package.json
{
"name": "@kalm/udp",
"version": "3.2.2",
"version": "3.2.3",
"description": "UDP transport for Kalm",

@@ -5,0 +5,0 @@ "main": "bin/udp.js",

@@ -1,152 +0,35 @@

/* Types ---------------------------------------------------------------------*/
declare module '@kalm/udp' {
interface UDPConfig {
type?: string
localAddr?: string
reuseAddr?: boolean
socketTimeout?: number
connectTimeout?: number
}
interface EventHandler {
(event?: any, event2?: any): void
}
interface KalmTransport {
(params: any, emitter: NodeJS.EventEmitter): Socket
}
interface EventEmitter {
on(type: string, handler: EventHandler): void
off(type: string, handler?: EventHandler): void
emit(type: string, evt?: any, evt2?: any): void
removeAllListeners(type?: string): void
listenerCount(type?: string): number
}
type Remote = {
host: string
port: number
}
interface ClientConfig {
label?: string
routine?: KalmRoutine
json?: Boolean
transport?: KalmTransport
port?: number
host?: string
isServer?: boolean
provider?: any
}
type SocketHandle = {
socket: any
port: number
host: string
}
interface ProviderConfig {
label?: string
routine?: KalmRoutine
json?: Boolean
transport?: KalmTransport
port?: number
host?: string
}
interface Socket {
bind: () => void
remote: (handle: SocketHandle) => Remote
connect: (handle?: SocketHandle) => SocketHandle
stop: () => void
send: (handle: SocketHandle, message: number[] | Buffer) => void
disconnect: (handle: SocketHandle) => void
}
type Remote = {
host: string
port: number
export default function udp(config?: UDPConfig): (config?: UDPConfig) => Transport;
}
interface Provider extends EventEmitter {
broadcast: (channel: string, message: Serializable) => void
label: string
stop: () => void
connections: Client[]
}
interface Client extends EventEmitter {
write: (channel: string, message: Serializable) => void
destroy: () => void
subscribe: (channel: string, handler: (body: any, frame: Frame) => any) => void
unsubscribe: (channel: string, handler: (body: any, frame: Frame) => any) => void
local: () => Remote
remote: () => Remote
}
type Channel = {
queue: Queue
emitter: EventEmitter
}
type ChannelList = {
[key: string]: Channel
}
type Serializable = Buffer | object | string | null
type UDPSocketHandle = {
socket: any
port: number
host: string
}
type UDPClient = {
client: Client
timeout: NodeJS.Timeout
data: Buffer[]
}
type UDPClientList = {
[key: string]: UDPClient
}
type SocketHandle = NodeJS.Socket | UDPSocketHandle | WebSocket
interface KalmRoutine {
(channel: string, params: any, channelEmitter: EventEmitter, clientEmitter: EventEmitter): Queue
}
interface KalmRoutineParams {
hz: number
maxBytes: number
seed: number
}
interface Queue {
add: (packet: Buffer) => void
size: () => number
flush: () => void
}
interface KalmTransport {
(params: any, emitter: EventEmitter): Socket
}
interface Socket {
bind: () => void
remote: (handle: SocketHandle) => Remote
connect: (handle?: SocketHandle) => SocketHandle
stop: () => void
send: (handle: SocketHandle, message: number[] | Buffer) => void
disconnect: (handle: SocketHandle) => void
}
interface IPCConfig {
socketTimeout?: number
path?: string
}
interface TCPConfig {
socketTimeout?: number
}
interface UDPConfig {
type?: string
localAddr?: string
reuseAddr?: boolean
socketTimeout?: number
connectTimeout?: number
}
interface WSConfig {
cert?: string
key?: string
secure?: boolean
}
interface WebRTCConfig {}
type RawFrame = {
frameId: number
channel: string
packets: Buffer[]
payloadBytes: number
}
type Frame = {
client: Client
channel: string
frame: {
id: number
messageIndex: number
payloadBytes: number
payloadMessages: number
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc