温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/bun/udp/SocketHandler/data
点击访问原文链接

SocketHandler.data method | Bun module | Bun

SocketHandler.data method | Bun module | BunBuildDocsReferenceGuidesBlogDiscord/Bun/udp/SocketHandler/dataMdata

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Bun/udp/SocketHandler/dataMdata

method

udp.SocketHandler.datadata(socket: SocketDataBinaryType>,data: BinaryTypeList[DataBinaryType],port: number,address: string,flags: ReceiveFlags): void | Promisevoid>;Referenced typesinterface SocketDataBinaryType extends BinaryType>readonly address: SocketAddressreadonly binaryType: keyof BinaryTypeListreadonly closed: booleanreadonly hostname: stringreadonly port: numberaddMembership(multicastAddress: string,interfaceAddress?: string): boolean;

Join a multicast group.

@param multicastAddress

The multicast group address

@param interfaceAddress

Optional interface address to use

@returns

true on success

addSourceSpecificMembership(sourceAddress: string,groupAddress: string,interfaceAddress?: string): boolean;

Join a source-specific multicast group.

@param sourceAddress

The source address

@param groupAddress

The multicast group address

@param interfaceAddress

Optional interface address to use

@returns

true on success

close(): void;dropMembership(multicastAddress: string,interfaceAddress?: string): boolean;

Leave a multicast group.

@param multicastAddress

The multicast group address

@param interfaceAddress

Optional interface address to use

@returns

true on success

dropSourceSpecificMembership(sourceAddress: string,groupAddress: string,interfaceAddress?: string): boolean;

Leave a source-specific multicast group.

@param sourceAddress

The source address

@param groupAddress

The multicast group address

@param interfaceAddress

Optional interface address to use

@returns

true on success

ref(): void;reload(handler: SocketHandlerDataBinaryType>): void;send(data: Data,port: number,address: string): boolean;sendMany(packets: readonly number | Data[]): number;setBroadcast(enabled: boolean): boolean;

Enable or disable SO_BROADCAST socket option.

@param enabled

Whether to enable broadcast

@returns

The enabled value

setMulticastInterface(interfaceAddress: string): boolean;

Set the IP_MULTICAST_IF socket option to specify the outgoing interface for multicast packets.

@param interfaceAddress

The address of the interface to use

@returns

true on success

setMulticastLoopback(enabled: boolean): boolean;

Enable or disable IP_MULTICAST_LOOP socket option.

@param enabled

Whether to enable multicast loopback

@returns

The enabled value

setMulticastTTL(ttl: number): number;

Set the IP_MULTICAST_TTL socket option.

@param ttl

Time to live value for multicast packets

@returns

The TTL value

setTTL(ttl: number): number;

Set the IP_TTL socket option.

@param ttl

Time to live value

@returns

The TTL value

unref(): void;interface ReceiveFlags

Extra metadata passed to the data callback for each received datagram.

truncated: boolean

true if the datagram was larger than the receive buffer and was truncated by the kernel (MSG_TRUNC). The data passed to the callback contains only the portion that fit in the buffer.

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

SocketHandler.data method | Bun module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for method bun.udp.SocketHandler.data | Bun