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

TCPSocket.end method | Bun module | Bun

TCPSocket.end method | Bun module | BunBuildDocsReferenceGuidesBlogDiscord/Bun/TCPSocket/endMend

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/Bun/TCPSocket/endMend

method

TCPSocket.endend(data?: string | BufferSource,byteOffset?: number,byteLength?: number): number;

Sends the final data chunk and initiates a graceful shutdown of the socket's write side. After calling end(), no more data can be written using write() or end(). The socket remains readable until the remote end also closes its write side or the connection is terminated. This sends a TCP FIN packet after writing the data.

@param data

Optional final data to write before closing. Same types as write().

@param byteOffset

Optional offset for buffer data.

@param byteLength

Optional length for buffer data.

@returns

The number of bytes written for the final chunk. Returns -1 if the socket was already closed or shutting down.

// send some data and close the write side
socket.end("Goodbye!");
// or close write side without sending final data
socket.end();
end(): void;

Close the socket immediately

Referenced typestype BufferSource = NodeJS.TypedArrayArrayBufferLike> | DataViewArrayBufferLike> | ArrayBufferLike

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 →

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

    API documentation for method bun.TCPSocket.end | Bun