Writing
Network Communication
Four layers of network communication, sockets, application protocols, HTML, HTTP, and server development.
Four Layers of Network Communication

Understanding Sockets Deeply
- A network communication tool calling the OS kernel. On creation, choose TCP (“three-way handshake, four-way wave-off”) or UDP one-shot communication.

- Sockets sit below the application layer.
What the Application Layer Solves
What content you transmit, e.g.:
-
FTP transfers files;
-
SSH remote commands.
-
SMTP and POP3 email;
-
Most common: HTTP
From Plain Text to HTML
Plain text structure is poor for display; structured data helps. Wrapping text is HTML:

For browser interaction, add JavaScript; browsers add a JS parser.

Extract JS parsing—even as backend—that is Node.js.
HTTP
Hypertext Transfer Protocol; the browser is the client.


HTTP status codes: http://tool.oschina.net/commons?type=5
Server Development Work

-
Parse client request messages
-
Support multithreaded concurrent access
Parameter Passing
- Query string after
?in URL