0.0.8 • Published 9 years ago

tcp.io v0.0.8

Weekly downloads
33
License
-
Repository
-
Last release
9 years ago

tcp.io

Server Example:

var tcp =require("tcp.io");
var server = new tcp.server()
server.on(function(c){
    c.on("ping", function(data){
        console.log("Server Count Request:%s",data.count);
        data.count++;
        data.message +=data.count
        c.emit("pong",data)
    })
});

server.listen(1337,"localhost")

Client Example:

var tcp =require("tcp.io");
var client = new tcp.client()
client.connect(1337,"localhost");
client.emit("ping",{count:0,message:"Hello"}
);
client.on("pong", function(data){
    data.count++
    console.log("From Server Message :%s",data.message);
    data.message="New Hello"
    client.emit("ping",data);
})
0.0.8

9 years ago

0.0.7

9 years ago

0.0.6

9 years ago

0.0.5

9 years ago

0.0.4

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago