extract ISocketAdapter
extract class server
add test