0.0.1 • Published 3 years ago

node-tcp-client v0.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

node-tcp-client

🚄 使用教程

安装

  npm i install node-tcp-client --save-dev or yarn add node-tcp-client --save-dev

使用

import TCPClient from "node-tcp-client"

let tcpClient = new TCPClient({ip,port})

📖 文档

TCPClient

Kind: global class

new TCPClient(options)

TCP客户端

ParamTypeDescription
optionsObjectip - 服务器ip port -服务器端口

tcpClient.setCallback(handle)

设置回调函数

ParamTypeDescription
handlefunction设置回调函数

tcpClient.send(data)

发送通信命令

ParamTypeDescription
dataObject消息

tcpClient.open(options)

开启client

ParamTypeDescription
optionsObjectip - 服务器ip port -服务器端口