1.0.27 • Published 6 years ago

parasocket v1.0.27

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

parasocket

  • a tcp socket server and client application
  • 1.0.26 add ParaSocket.d.ts

https://www.npmjs.com/package/parasocket


how to open log

  • ParaSocket.showLog =true;//open para log

how to add server

  • step 1 declare a socket :ServerDate extends SocketData,has clear function realization
  • step2
    • ParaSocket.registorServerSocketData("user",ServerData);
  • step3 add server
    • ParaSocket.addServer(0,"user",8081,EnumServerType.ipv4_server);
  • step4 add callback function
    • ParaSocket.addCallback('user',1,(name:string,socketid:number,cmdid:number,buff:Buffer)=>{ console.log("do something"); });

how to add client

  • step 1 add client
    • ParaSocket.addClient(-1,"uu",8081,myip);
  • step 2 add callback function
    • ParaSocket.addCmmandCallback('uu',2,(name:string,socketid:number,cmdid:number,buff:Buffer)=>{ console.log("CLIENT:::::"+name+":socketid="+socketid+":CMDID:"+cmdid); })
  • step 3 send message to server
    • ParaSocket.sendmsg2Server('uu',1,Buffer.alloc(10));

1.0.27

6 years ago

1.0.26

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago