How to develop TCP Server (Network) application using NodeJs

preview_player
Показать описание
-How to develop a simple TCP/IP (Network) Server from the scratch using NodeJs
-How to use "net" module (package) in NodeJs
-How to use "colors" module (package) in NodeJs
-How to work create TCP Server and listen for connections (sockets)
-What are sockets in NodeJs
-How to work with sockets in NodeJs
-How to handle socket connections in NodeJs
-How to send data to TCP Server using socket
-How to return data from TCP Server using socket
Рекомендации по теме
Комментарии
Автор

This was really helpful. for a person that has never used a socket in javascript, this is recommended!

TheXmas
Автор

Thank you for this . Hardly anyone actually explains what any of this means the way you do. Thank you very much

durrhurr
Автор

I am curious about the point at 27:20
Do we really need to put the socket.on inside of the server.on function?

Somehow server.on("connect" function(socket) {console.log("text"); socket.on("data" function(d) {console.log("%s", d); }); )}; supposedly output on every incoming package, despite the socket.on being inside another function that only executes its contents on new connections. So the whole part at 31:05 logically shouldn't happen. Since at 13:10 it is clearly shown that server.on("connect" function() {console.log("text"); )}; doesn't output with each new package sent unless it is a new connection. So nothing inside of server.on("connect" function() {code}); should execute more than once, and exclusively on a new connection, since that is when server.on("connection" triggers.

This is all frankly counterintuitive and confusing, since where is the line between stuff that only executes when server.on("connection" is triggered, and when stuff is generally just running under the local variable space of server.on("connection" function() {, since these two are quite different things.

I however consider this a major fault of Node.JS and not of the tutorial, the tutorial is honestly one of the better coding tutorials I have watched.

Though, personally I would have server.on("connection" function(socket) export our socket object to a less local domain where our socket.on events is handled outside of server.on

todayonthebench
Автор

Thank you!!! Your detailed explanations helped me to understand the code and more importantly, how to learn better on my own.

chrislamb
Автор

Nice and helpful tutorial. Very detail and easy to understand!!!

sangtran
Автор

Much obliged, Sir, you have helped me big time. Bahudha upakritosmi.

srinivasrg
Автор

Thank you so much for this helpful video! Brilliant!

samuelhuang
Автор

Excellent tutorial! I used node.js with mac and terminal, everything worked fine! :) congrats!

pepecalixto
Автор

This was well explained that i had to comment to thank you, thank you very much!!!

willl
Автор

beautiful concept on socket, really I like it very much

mohammadadilalam
Автор

ur explanations ar expland very well, thank u Sir.

djpaulieshark
Автор

This was extremely helpful. Is it possible for the server to listen from multiple clients(simultaneously) via different ports or using any other module?

sidharths
Автор

Thank you very much for the video. Just one quick question :

why does the server send another 'empty' response after it send back the response message?.

For example in 37:15, if you have a look, when you receive 'Hello Jag' it also receives an empty response from the server right after. Why is that?

Marcos
Автор

this is great explanation, thx for video

swoopertr
Автор

I have a domain and hosting. How can i deploy it online? Is it suitable to deploy it online?

cangorkemgunes
Автор

Very useful video. But how to send data in JSON and get it on a server?

harmeat
Автор

Is the "require("net") an internal library?

thanasisathanasi
Автор

Hi, I have to implement the TCP server for some GPS tracking device(they use TCP/UDP). how can i make it with security?

JoJo-hhye
Автор

please post Express.js tutorials as soon as possible I'll very grateful to you

hfz.arslan
Автор

You should be using const/let and not var

gosnooky
visit shbcf.ru