摘要:This paper describes P4P(Proactive network Provider Participation for peer-to-peer) network server based on the Half-Sync/Half-Async and Pipe/Filter design patterns, which implements the requirements of the P4P system. The P4P network server applies the Half-Async layer to listen to the specified network port and establishes network connections asynchronously; makes use of message queue layer to buffer established network connections; applies the Pipe/Filter pattern into the Half-Sync layer and takes the Half-Sync layer to receive data and send data concurrently. Thanks to these patterns and the design, it gains various levels of concurrency and flexibility