Awesome
capacitor-udp
UDP Plugin for CapacitorJS based on the UDP Plugin of https://github.com/unitree-czk/capacitor-udp which is no longer maintained. So a new repo to push the plugin to be suitable for CapacitorJS 3+.
Install
npm install @frontall/capacitor-udp
npx cap sync
API
<docgen-index>create(...)
update(...)
setPaused(...)
bind(...)
send(...)
closeAllSockets()
close(...)
getInfo(...)
getSockets()
joinGroup(...)
leaveGroup(...)
setMulticastTimeToLive(...)
setBroadcast(...)
setMulticastLoopbackMode(...)
getJoinedGroups()
addListener(...)
addListener(...)
- Interfaces
create(...)
create(options?: { properties?: { name?: string | undefined; bufferSize?: number | undefined; } | undefined; } | undefined) => any
Param | Type |
---|---|
options | <code>{ properties?: { name?: string; bufferSize?: number; }; }</code> |
Returns: <code>any</code>
update(...)
update(options: { socketId: number; properties: { name?: string; bufferSize?: number; }; }) => any
Param | Type |
---|---|
options | <code>{ socketId: number; properties: { name?: string; bufferSize?: number; }; }</code> |
Returns: <code>any</code>
setPaused(...)
setPaused(options: { socketId: number; paused: boolean; }) => any
Param | Type |
---|---|
options | <code>{ socketId: number; paused: boolean; }</code> |
Returns: <code>any</code>
bind(...)
bind(options: { socketId: number; address: string; port: number; }) => any
Param | Type |
---|---|
options | <code>{ socketId: number; address: string; port: number; }</code> |
Returns: <code>any</code>
send(...)
send(options: { socketId: number; address: string; port: number; buffer: string; }) => any
Param | Type |
---|---|
options | <code>{ socketId: number; address: string; port: number; buffer: string; }</code> |
Returns: <code>any</code>
closeAllSockets()
closeAllSockets() => any
Returns: <code>any</code>
close(...)
close(options: { socketId: number; }) => any
Param | Type |
---|---|
options | <code>{ socketId: number; }</code> |
Returns: <code>any</code>
getInfo(...)
getInfo(options: { socketId: number; }) => any
Param | Type |
---|---|
options | <code>{ socketId: number; }</code> |
Returns: <code>any</code>
getSockets()
getSockets() => any
Returns: <code>any</code>
joinGroup(...)
joinGroup(options: { socketId: number; address: string; }) => any
Param | Type |
---|---|
options | <code>{ socketId: number; address: string; }</code> |
Returns: <code>any</code>
leaveGroup(...)
leaveGroup(options: { socketId: number; address: string; }) => any
Param | Type |
---|---|
options | <code>{ socketId: number; address: string; }</code> |
Returns: <code>any</code>
setMulticastTimeToLive(...)
setMulticastTimeToLive(options: { socketId: number; ttl: number; }) => any
Param | Type |
---|---|
options | <code>{ socketId: number; ttl: number; }</code> |
Returns: <code>any</code>
setBroadcast(...)
setBroadcast(options: { socketId: number; enabled: boolean; }) => any
Param | Type |
---|---|
options | <code>{ socketId: number; enabled: boolean; }</code> |
Returns: <code>any</code>
setMulticastLoopbackMode(...)
setMulticastLoopbackMode(options: { socketId: number; enabled: boolean; }) => any
Param | Type |
---|---|
options | <code>{ socketId: number; enabled: boolean; }</code> |
Returns: <code>any</code>
getJoinedGroups()
getJoinedGroups() => any
Returns: <code>any</code>
addListener(...)
addListener(events: 'receive', functions: (params: { socketId: number; buffer: string; }) => void) => PluginListenerHandle
Param | Type |
---|---|
events | <code>"receive"</code> |
functions | <code>(params: { socketId: number; buffer: string; }) => void</code> |
Returns: <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
addListener(...)
addListener(events: 'receiveError', functions: (params: string) => void) => PluginListenerHandle
Param | Type |
---|---|
events | <code>"receiveError"</code> |
functions | <code>(params: string) => void</code> |
Returns: <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
Interfaces
PluginListenerHandle
Prop | Type |
---|---|
remove | <code>() => any</code> |