Dashboard
Repositories
filestore
Aktivität
Suche
Login
public
/
web-development/examples
Web Development Examples
Übersicht
Reflog
Commits
Dateibaum
Dokumentation
Forks
Vergleichen
Blame
|
Historie
|
Raw
add tcp server and client examples
Sascha Schulz
2024-09-30
e25a8139ba2bb21c9e2e65658ccdf597248894eb
[public/web-development/examples.git]
/
templates
/
010-nodejs
/
tcp-server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
const net = require("net");
const server = net.createServer((socket) => {
// new incoming connection
socket.on("data", (data) => {
// data is a buffer
});
socket.write("Hello World!");
});
server.listen(3000);