add socket.cpp and buffer.h