Home

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> </docgen-index> <docgen-api> <!--Update the source file JSDoc comments and rerun docgen to update the docs below-->

create(...)

create(options?: { properties?: { name?: string | undefined; bufferSize?: number | undefined; } | undefined; } | undefined) => any
ParamType
options<code>{ properties?: { name?: string; bufferSize?: number; }; }</code>

Returns: <code>any</code>


update(...)

update(options: { socketId: number; properties: { name?: string; bufferSize?: number; }; }) => any
ParamType
options<code>{ socketId: number; properties: { name?: string; bufferSize?: number; }; }</code>

Returns: <code>any</code>


setPaused(...)

setPaused(options: { socketId: number; paused: boolean; }) => any
ParamType
options<code>{ socketId: number; paused: boolean; }</code>

Returns: <code>any</code>


bind(...)

bind(options: { socketId: number; address: string; port: number; }) => any
ParamType
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
ParamType
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
ParamType
options<code>{ socketId: number; }</code>

Returns: <code>any</code>


getInfo(...)

getInfo(options: { socketId: number; }) => any
ParamType
options<code>{ socketId: number; }</code>

Returns: <code>any</code>


getSockets()

getSockets() => any

Returns: <code>any</code>


joinGroup(...)

joinGroup(options: { socketId: number; address: string; }) => any
ParamType
options<code>{ socketId: number; address: string; }</code>

Returns: <code>any</code>


leaveGroup(...)

leaveGroup(options: { socketId: number; address: string; }) => any
ParamType
options<code>{ socketId: number; address: string; }</code>

Returns: <code>any</code>


setMulticastTimeToLive(...)

setMulticastTimeToLive(options: { socketId: number; ttl: number; }) => any
ParamType
options<code>{ socketId: number; ttl: number; }</code>

Returns: <code>any</code>


setBroadcast(...)

setBroadcast(options: { socketId: number; enabled: boolean; }) => any
ParamType
options<code>{ socketId: number; enabled: boolean; }</code>

Returns: <code>any</code>


setMulticastLoopbackMode(...)

setMulticastLoopbackMode(options: { socketId: number; enabled: boolean; }) => any
ParamType
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
ParamType
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
ParamType
events<code>"receiveError"</code>
functions<code>(params: string) => void</code>

Returns: <code><a href="#pluginlistenerhandle">PluginListenerHandle</a></code>


Interfaces

PluginListenerHandle

PropType
remove<code>() => any</code>
</docgen-api>