a simple implementation of TCP socket, which needs improvement in the future