Skip to content

Commit

Permalink
chore(release): 4.3.0 [skip ci]
Browse files Browse the repository at this point in the history
# [4.3.0](v4.2.0...v4.3.0) (2020-08-12)

### Features

* Add socket.setEncoding() method ([#74](#74)) ([bfa80ea](bfa80ea))
  • Loading branch information
semantic-release-bot committed Aug 12, 2020
1 parent bfa80ea commit b8a51d3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 2 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [4.3.0](https://github.com/Rapsssito/react-native-tcp-socket/compare/v4.2.0...v4.3.0) (2020-08-12)


### Features

* Add socket.setEncoding() method ([#74](https://github.com/Rapsssito/react-native-tcp-socket/issues/74)) ([bfa80ea](https://github.com/Rapsssito/react-native-tcp-socket/commit/bfa80ea3b690f8a486882b4921397633957f4686))

# [4.2.0](https://github.com/Rapsssito/react-native-tcp-socket/compare/v4.1.0...v4.2.0) (2020-07-06)


Expand Down
2 changes: 1 addition & 1 deletion coverage/coverage-final.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/types/TcpServer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export default class TcpServer extends TcpSocket {
tlsCert?: any;
}, callback?: ((address: string) => void) | undefined): TcpServer;
setTimeout(timeout: number, callback?: (() => void) | undefined): TcpServer;
setEncoding(encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined): TcpServer;
setNoDelay(noDelay?: boolean): TcpServer;
setKeepAlive(enable?: boolean, initialDelay?: number): TcpServer;
addListener(event: string | symbol, listener: (...args: any[]) => void): TcpServer;
Expand Down
11 changes: 11 additions & 0 deletions lib/types/TcpSocket.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export default class TcpSocket extends EventEmitter {
_timeout: NodeJS.Timeout | undefined;
/** @type {number} */
_state: number;
_encoding: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined;
/**
* @protected
*/
Expand Down Expand Up @@ -80,6 +81,16 @@ export default class TcpSocket extends EventEmitter {
* @private
*/
private _clearTimeout;
/**
* Set the encoding for the socket as a Readable Stream. By default, no encoding is assigned and stream data will be returned as `Buffer` objects.
* Setting an encoding causes the stream data to be returned as strings of the specified encoding rather than as Buffer objects.
*
* For instance, calling `socket.setEncoding('utf8')` will cause the output data to be interpreted as UTF-8 data, and passed as strings.
* Calling `socket.setEncoding('hex')` will cause the data to be encoded in hexadecimal string format.
*
* @param {BufferEncoding} [encoding]
*/
setEncoding(encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined): TcpSocket;
/**
* Enable/disable the use of Nagle's algorithm. When a TCP connection is created, it will have Nagle's algorithm enabled.
*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "react-native-tcp-socket",
"title": "React Native Tcp Socket",
"version": "4.2.0",
"version": "4.3.0",
"description": "React Native TCP socket API for Android & iOS with SSL/TLS support",
"main": "src/index.js",
"types": "lib/types/index.d.ts",
Expand Down

0 comments on commit b8a51d3

Please sign in to comment.