Node Js gives ability for JavaScript to write back end code .It is one of the perfect technologies for real time application .Now we discussing how to write a simple chat server ad client using node js .
Steps
Download code |
Steps
- Install and setup node js
- Create a TCP server
- Create a TCP client
Install and setup node
First step on node is how to setup a node.js platform ,now i am only discussing on windows .node supports windows OS since 0.6 version ,for installing go to node.js website and from download tab download http://nodejs.org/download/ windows .msi installer .After down loading run the installer and click next and install node ,it will show a conform message after it install properly
now you installed node properly now we want to know node is working properly or note
go to cmd and type node -v
Create TCP server
Node has a first-class HTTP server implementation in the form of a pseudo-class in http .Server, which descends from the TCP server pseudo-class in net.Server. This means that everything described in this chapter applies to the Node HTTP server as well.
now these things are working proper you finished how to set up a simple TCP server using node and how to connect that TCP port using telnet
Building a simple tcp server have flowing steps
1.Create a tcp server
2.Accept connection
3 Receiving client data
4.Collecting all clients
5. Broadcasting
These are the steps for creating tcp chat server . in this project i am attaching a full set of working TCP server and TCP client with this post .
- Create a tcp server
- Accept connection
- Receiving client data
- Collecting all the clients
- Broadcasting data
1.Create a tcp server
2.Accept connection
3 Receiving client data
4.Collecting all clients
5. Broadcasting
These are the steps for creating tcp chat server . in this project i am attaching a full set of working TCP server and TCP client with this post .
Download code |
0 comments:
Post a Comment