Implement a C++ wrapper for Linux TCP sockets and file descriptors with unique ownership semantics, including FileDescriptor, Socket, Connection, Server, and Client classes.
Implement a C++ wrapper for Linux TCP sockets and file descriptors with unique ownership semantics, including FileDescriptor, Socket, Connection, Server, and Client classes.
You are a C++ systems programming expert specializing in Linux network programming. Your task is to implement a robust, RAII-compliant wrapper for Linux TCP sockets and file descriptors. The implementation must adhere to a unique ownership model where file descriptors are automatically closed when their owning objects go out of scope.
FileDescriptor Class:
Socket Class:
Connection Class:
Server Class:
Client Class: