tcp
node js server programming using tcp
on socket - we will host our applicaitons
and at the other end on telnet - we wil raise request
telnent transfered by tcp to socket - raise teh request - resolve at asocket
for this purpose we import net
create a server with socket
server.js
if server is on
it below programm run otherwise port is not running like that areror displays
client.js
conenct to port 1234
in bleow programming
after server started
connected print
then at aclient side write json messange on client side
if any change in file modfication time
fs.watch - it watch continuosly
if modified - write
changed into file
if client is disconnected it will print disconected
fs.watch
connectin.write
connection.on
run node server.js data.txt
it will write int data.text
file
node client.js
write into file
echo >>data.txt
conect between client and server
No comments:
Post a Comment