I developed an open source framework smart-socket, all aspects are still quite satisfactory, except that there is a strange phenomenon can not find a solution.
This project in Windows, Linux system can be stable operation, but the operation under the Mac will lead to the system run around the restart.
Project address: https://github.com/smthing/smart-socket
Download to the local start after the first P2PServer, and then start P2PMultiClient, running on the Mac for a minute or two should crash.