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

Socket.setTypeOfService method | Node.js net module | Bun

Socket.setTypeOfService method | Node.js net module | BunBuildDocsReferenceGuidesBlogDiscord/node:net/Socket/setTypeOfServiceMsetTypeOfService

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:net/Socket/setTypeOfServiceMsetTypeOfService

method

net.Socket.setTypeOfServicesetTypeOfService(tos: number): this;

Sets the Type of Service (TOS) field for IPv4 packets or Traffic Class for IPv6 Packets sent from this socket. This can be used to prioritize network traffic.

setTypeOfService() may be called before the socket is connected; the value will be cached and applied when the socket establishes a connection. getTypeOfService() will return the currently set value even before connection.

On some platforms (e.g., Linux), certain TOS/ECN bits may be masked or ignored, and behavior can differ between IPv4 and IPv6 or dual-stack sockets. Callers should verify platform-specific semantics.

@param tos

The TOS value to set (0-255).

@returns

The socket itself.

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 →

Socket.setTypeOfService method | Node.js net module | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for method node:net.Socket.setTypeOfService | Bun