hc-capacitor-udp
capacitor udp
Install
npm install hc-capacitor-udp
npx cap sync
API
create(...)
update(...)
setPaused(...)
bind(...)
send(...)
closeAllSockets()
close(...)
getInfo(...)
getSockets()
joinGroup(...)
leaveGroup(...)
setMulticastTimeToLive(...)
setBroadcast(...)
setMulticastLoopbackMode(...)
getJoinedGroups()
addListener('receive', ...)
addListener('receiveError', ...)
- Interfaces
create(...)
create(options?: { properties?: { name?: string | undefined; bufferSize?: number | undefined; } | undefined; } | undefined) => Promise<{ socketId: number; ipv4: string; ipv6: string; }>
Param | Type |
---|---|
options |
{ properties?: { name?: string; bufferSize?: number; }; } |
Returns: Promise<{ socketId: number; ipv4: string; ipv6: string; }>
update(...)
update(options: { socketId: number; properties: { name?: string; bufferSize?: number; }; }) => Promise<any>
Param | Type |
---|---|
options |
{ socketId: number; properties: { name?: string; bufferSize?: number; }; } |
Returns: Promise<any>
setPaused(...)
setPaused(options: { socketId: number; paused: boolean; }) => Promise<any>
Param | Type |
---|---|
options |
{ socketId: number; paused: boolean; } |
Returns: Promise<any>
bind(...)
bind(options: { socketId: number; address: string; port: number; }) => Promise<any>
Param | Type |
---|---|
options |
{ socketId: number; address: string; port: number; } |
Returns: Promise<any>
send(...)
send(options: { socketId: number; address: string; port: number; buffer: string; }) => Promise<any>
Param | Type |
---|---|
options |
{ socketId: number; address: string; port: number; buffer: string; } |
Returns: Promise<any>
closeAllSockets()
closeAllSockets() => Promise<any>
Returns: Promise<any>
close(...)
close(options: { socketId: number; }) => Promise<any>
Param | Type |
---|---|
options |
{ socketId: number; } |
Returns: Promise<any>
getInfo(...)
getInfo(options: { socketId: number; }) => Promise<{ socketId: number; bufferSize: number; name: string | null; paused: boolean; localAddress?: string; localPort?: number; }>
Param | Type |
---|---|
options |
{ socketId: number; } |
Returns: Promise<{ socketId: number; bufferSize: number; name: string | null; paused: boolean; localAddress?: string; localPort?: number; }>
getSockets()
getSockets() => Promise<{ sockets: [{ socketId: number; bufferSize: number; name: string | null; paused: boolean; localAddress?: string; localPort?: number; }]; }>
Returns: Promise<{ sockets: [{ socketId: number; bufferSize: number; name: string | null; paused: boolean; localAddress?: string; localPort?: number; }]; }>
joinGroup(...)
joinGroup(options: { socketId: number; address: string; }) => Promise<any>
Param | Type |
---|---|
options |
{ socketId: number; address: string; } |
Returns: Promise<any>
leaveGroup(...)
leaveGroup(options: { socketId: number; address: string; }) => Promise<any>
Param | Type |
---|---|
options |
{ socketId: number; address: string; } |
Returns: Promise<any>
setMulticastTimeToLive(...)
setMulticastTimeToLive(options: { socketId: number; ttl: number; }) => Promise<any>
Param | Type |
---|---|
options |
{ socketId: number; ttl: number; } |
Returns: Promise<any>
setBroadcast(...)
setBroadcast(options: { socketId: number; enabled: boolean; }) => Promise<any>
Param | Type |
---|---|
options |
{ socketId: number; enabled: boolean; } |
Returns: Promise<any>
setMulticastLoopbackMode(...)
setMulticastLoopbackMode(options: { socketId: number; enabled: boolean; }) => Promise<any>
Param | Type |
---|---|
options |
{ socketId: number; enabled: boolean; } |
Returns: Promise<any>
getJoinedGroups()
getJoinedGroups() => Promise<{ groups: [string]; }>
Returns: Promise<{ groups: [string]; }>
addListener('receive', ...)
addListener(events: "receive", functions: (params: { socketId: number; buffer: string; }) => void) => PluginListenerHandle
Param | Type |
---|---|
events |
'receive' |
functions |
(params: { socketId: number; buffer: string; }) => void |
Returns: PluginListenerHandle
addListener('receiveError', ...)
addListener(events: "receiveError", functions: (params: string) => void) => PluginListenerHandle
Param | Type |
---|---|
events |
'receiveError' |
functions |
(params: string) => void |
Returns: PluginListenerHandle
Interfaces
PluginListenerHandle
Prop | Type |
---|---|
remove |
() => Promise<void> |