1- # react-native-tcp-socket
1+ # react-native-tcp-socket <!-- omit in toc -->
22<p align =" center " >
33 <img src =" https://github.com/Rapsssito/react-native-tcp-socket/workflows/tests/badge.svg " />
44 <img src =" https://img.shields.io/npm/dw/react-native-tcp-socket " />
77
88React Native TCP socket API for Android & iOS with ** client SSL/TLS support** . It allows you to create TCP clients and servers sockets, imitating some of Node's [ net] ( https://nodejs.org/api/net.html ) API functionalities (check the available [ API] ( #api ) for more information).
99
10- ## Table of Contents
10+ ## Table of Contents <!-- omit in toc -->
1111
1212- [ Getting started] ( #getting-started )
13- - [ Self-Signed SSL] ( #self-signed-ssl-only-available-for-react-native--060 )
14- - [ Compatibility] ( #react-native-compatibility )
13+ - [ Using React Native >= 0.60] ( #using-react-native--060 )
14+ - [ Self-Signed SSL (only available for React Native > 0.60)] ( #self-signed-ssl-only-available-for-react-native--060 )
15+ - [ Using React Native < 0.60] ( #using-react-native--060-1 )
16+ - [ React Native Compatibility] ( #react-native-compatibility )
1517- [ Usage] ( #usage )
18+ - [ Client] ( #client )
19+ - [ Server] ( #server )
20+ - [ SSL Client] ( #ssl-client )
1621- [ API] ( #api )
1722 - [ TcpSocket] ( #tcpsocket )
23+ - [ ` createConnection() ` ] ( #createconnection )
1824 - [ TcpServer] ( #tcpserver )
25+ - [ ` listen() ` ] ( #listen )
1926- [ Maintainers] ( #maintainers )
2027- [ Acknowledgments] ( #acknowledgments )
2128- [ License] ( #license )
@@ -195,6 +202,12 @@ Here are listed all methods implemented in `react-native-tcp-socket`, their func
195202 * [ ` setNoDelay([noDelay]) ` ] ( https://nodejs.org/api/net.html#net_socket_setnodelay_nodelay )
196203 * [ ` setTimeout(timeout[, callback]) ` ] ( https://nodejs.org/api/net.html#net_socket_settimeout_timeout_callback )
197204 * [ ` write(data[, encoding][, callback]) ` ] ( https://nodejs.org/api/net.html#net_socket_write_data_encoding_callback )
205+ * ** Properties:**
206+ * [ ` 'remoteAddress' ` ] ( https://nodejs.org/api/net.html#net_socket_remoteaddress )
207+ * [ ` 'remoteFamily' ` ] ( https://nodejs.org/api/net.html#net_socket_remotefamily )
208+ * [ ` 'remotePort' ` ] ( https://nodejs.org/api/net.html#net_socket_remoteport )
209+ * [ ` 'localAddress' ` ] ( https://nodejs.org/api/net.html#net_socket_localaddress )
210+ * [ ` 'localPort' ` ] ( https://nodejs.org/api/net.html#net_socket_localport )
198211* ** Events:**
199212 * [ ` 'close' ` ] ( https://nodejs.org/api/net.html#net_event_close_1 )
200213 * [ ` 'connect' ` ] ( https://nodejs.org/api/net.html#net_event_connect )
@@ -203,7 +216,7 @@ Here are listed all methods implemented in `react-native-tcp-socket`, their func
203216
204217#### ` createConnection() `
205218` createConnection(options[, callback]) ` creates a TCP connection using the given [ ` options ` ] ( #createconnection-options ) .
206- ##### ` createConnection: options `
219+ ##### ` createConnection: options ` <!-- omit in toc -->
207220** Required** . Available options for creating a socket. It must be an ` object ` with the following properties:
208221
209222| Property | Type | iOS | Android | Description |
@@ -226,11 +239,16 @@ Here are listed all methods implemented in `react-native-tcp-socket`, their func
226239 * [ ` TcpSocket.createServer(connectionListener) ` ] ( https://nodejs.org/api/net.html#net_net_createserver_options_connectionlistener )
227240 * ** [ ` listen(options[, callback]) ` ] ( #listen ) **
228241 * [ ` close([callback]) ` ] ( https://nodejs.org/api/net.html#net_server_close_callback )
242+ * ** Events:**
243+ * [ ` 'close' ` ] ( https://nodejs.org/api/net.html#net_event_close )
244+ * [ ` 'connection' ` ] ( https://nodejs.org/api/net.html#net_event_connection )
245+ * [ ` 'error' ` ] ( https://nodejs.org/api/net.html#net_event_error )
246+ * [ ` 'listening' ` ] ( https://nodejs.org/api/net.html#net_event_listening )
229247
230248#### ` listen() `
231249` listen(options[, callback]) ` creates a TCP server socket using the given [ ` options ` ] ( #listen-options ) .
232250
233- ##### ` listen: options `
251+ ##### ` listen: options ` <!-- omit in toc -->
234252** Required** . Available options for creating a server socket. It must be an ` object ` with the following properties:
235253
236254| Property | Type | iOS | Android | Description |
0 commit comments