# tcp_wrapper **Repository Path**: winter-loo/tcp_wrapper ## Basic Information - **Project Name**: tcp_wrapper - **Description**: tcp/ip network programming design pattern in c++ - **Primary Language**: C++ - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2015-08-26 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # TCP IP Network Programming Design Patterns in C++ **The model**
+------------+         +----------------+
|            |         |                |
|   client   +--------->  server_client |
|            |         |                |
+------------+         +-------+--------+
                               |         
                               |         
                               |         
                               |         
                       +-------v--------+
                       |                |
                       |     server     |
                       |                |
                       +----------------+
## [TODO] ### implement the timeout mechanism **What have I tried?** - `signal`/`alarm` function inside TCPStream::Recv(char * buffer, size_t len, const int wait_time) I cannot call `close(sockfd_)` inside the sianal handler fucntion - use `setsockopt()` to set the socket's `SO_RCVTIMEO` option Have to add an additional parameter(`wait_time`) to TCPStream constructor