Implementing a Single-Threaded Blocking Bare Bones TCP/IP Server
The article explains creating a single-threaded TCP/IP server in Java, covering port listening, client connections, message handling, and server behavior. It discusses networking concepts and demonstrates concurrent client connections.
Read original articleThis article discusses the implementation of a single-threaded blocking TCP/IP server in Java. The code provided demonstrates how to create a basic server that listens on a specific port, accepts incoming client connections, reads messages from clients, and echoes them back. The server uses streams for communication, converting byte streams to character streams for text-based data exchange. The article explains the concepts of IP addresses, ports, and sockets in network communication, highlighting their roles in facilitating communication between clients and servers. Additionally, it covers the use of Telnet for testing the server's functionality and discusses the server's single-threaded blocking behavior when handling client requests sequentially. The article concludes with a demonstration of spawning multiple client threads to send concurrent connection requests to the server. Overall, it provides a comprehensive overview of building a basic TCP/IP server and understanding the underlying networking concepts involved.
Related
Timeliness without datagrams using QUIC
The debate between TCP and UDP for internet applications emphasizes reliability and timeliness. UDP suits real-time scenarios like video streaming, while QUIC with congestion control mechanisms ensures efficient media delivery.
The FreeBSD-native-ish home lab and network
The author details a complex home lab setup with a FreeBSD server on a laptop, utilizing Jails for services like WordPress and emphasizing security measures and network configurations for efficiency and functionality.
Winpopup (2001)
Discovery of WinPopup.exe in Windows 98 allows LAN message exchange. Workgroups in Windows enable resource sharing. Instructions for use provided, emphasizing recipient's need for WinPopup running. Author praises WinPopup for Windows communication.
Migrating from Java 8 to Java 17 II: Notable API Changes Since Java 8
The article details API changes in Java versions 9 to 17, emphasizing improvements for Java 8 migrations. Changes include null handling, performance enhancements, string improvements, switch expressions, record classes, and utility additions for developer productivity and code readability.
Four lines of code it was four lines of code
The programmer resolved a CPU utilization issue by removing unnecessary Unix domain socket code from a TCP and TLS service handler. This debugging process emphasized meticulous code review and system interaction understanding.
I've implemented something similar for a pet project, trying to make a very concise http(s) server with raw python.
It works with bytes for speed and handles a lot of tricky edge cases I couldn't find in other implementations (like request paths that were over 16k bytes long) that I needed for my frontend. It has microsecond-level logging, a packet proxy, and a supervisor, all as separate binaries that interact.
Related
Timeliness without datagrams using QUIC
The debate between TCP and UDP for internet applications emphasizes reliability and timeliness. UDP suits real-time scenarios like video streaming, while QUIC with congestion control mechanisms ensures efficient media delivery.
The FreeBSD-native-ish home lab and network
The author details a complex home lab setup with a FreeBSD server on a laptop, utilizing Jails for services like WordPress and emphasizing security measures and network configurations for efficiency and functionality.
Winpopup (2001)
Discovery of WinPopup.exe in Windows 98 allows LAN message exchange. Workgroups in Windows enable resource sharing. Instructions for use provided, emphasizing recipient's need for WinPopup running. Author praises WinPopup for Windows communication.
Migrating from Java 8 to Java 17 II: Notable API Changes Since Java 8
The article details API changes in Java versions 9 to 17, emphasizing improvements for Java 8 migrations. Changes include null handling, performance enhancements, string improvements, switch expressions, record classes, and utility additions for developer productivity and code readability.
Four lines of code it was four lines of code
The programmer resolved a CPU utilization issue by removing unnecessary Unix domain socket code from a TCP and TLS service handler. This debugging process emphasized meticulous code review and system interaction understanding.