fixed seg fault bug in StreamSocket.cpp