diff --git a/index.d.ts b/index.d.ts index fbb48e98..cf97ed8c 100644 --- a/index.d.ts +++ b/index.d.ts @@ -48,12 +48,11 @@ export type RecognizedString = string | ArrayBuffer | Uint8Array | Int8Array | U * Read more about this in the user manual. */ export interface WebSocket { - /** Sends a message. Make sure to check getBufferedAmount() before sending. Returns true for success, false for built up backpressure that will drain when time is given. - * Returning false does not mean nothing was sent, it only means backpressure was built up. This you can check by calling getBufferedAmount() afterwards. + /** Sends a message. Returns 1 for success, 2 for dropped due to backpressure limit, and 0 for built up backpressure that will drain over time. You can check backpressure before or after sending by calling getBufferedAmount(). * * Make sure you properly understand the concept of backpressure. Check the backpressure example file. */ - send(message: RecognizedString, isBinary?: boolean, compress?: boolean) : boolean; + send(message: RecognizedString, isBinary?: boolean, compress?: boolean) : number; /** Returns the bytes buffered in backpressure. This is similar to the bufferedAmount property in the browser counterpart. * Check backpressure example. @@ -70,8 +69,8 @@ export interface WebSocket { */ close() : void; - /** Sends a ping control message. Returns true on success in similar ways as WebSocket.send does (regarding backpressure). This helper function correlates to WebSocket::send(message, uWS::OpCode::PING, ...) in C++. */ - ping(message?: RecognizedString) : boolean; + /** Sends a ping control message. Returns sendStatus similar to WebSocket.send (regarding backpressure). This helper function correlates to WebSocket::send(message, uWS::OpCode::PING, ...) in C++. */ + ping(message?: RecognizedString) : number; /** Subscribe to a topic. */ subscribe(topic: RecognizedString) : boolean; diff --git a/source_commit b/source_commit index 8e665816..09d71f6d 100644 --- a/source_commit +++ b/source_commit @@ -1 +1 @@ -0c6615488d03426435b1c3f28a8186e574787411 +3b1bba8af8a3652dde15c82c31a14e28cd3500a7 diff --git a/uws_darwin_arm64_108.node b/uws_darwin_arm64_108.node index 3c50099e..29d75667 100644 Binary files a/uws_darwin_arm64_108.node and b/uws_darwin_arm64_108.node differ diff --git a/uws_darwin_arm64_83.node b/uws_darwin_arm64_83.node index dfc0a682..aaad4ba0 100644 Binary files a/uws_darwin_arm64_83.node and b/uws_darwin_arm64_83.node differ diff --git a/uws_darwin_arm64_93.node b/uws_darwin_arm64_93.node index 74a44448..6ed2e54d 100644 Binary files a/uws_darwin_arm64_93.node and b/uws_darwin_arm64_93.node differ diff --git a/uws_darwin_x64_108.node b/uws_darwin_x64_108.node index 8c7f1bcf..146ab157 100644 Binary files a/uws_darwin_x64_108.node and b/uws_darwin_x64_108.node differ diff --git a/uws_darwin_x64_83.node b/uws_darwin_x64_83.node index 57ac5e0c..89a56853 100644 Binary files a/uws_darwin_x64_83.node and b/uws_darwin_x64_83.node differ diff --git a/uws_darwin_x64_93.node b/uws_darwin_x64_93.node index d8d37ec4..52c37230 100644 Binary files a/uws_darwin_x64_93.node and b/uws_darwin_x64_93.node differ