abstraction for socket (win / linux)