Disposing socket in a proper way.
"EndPoint" does not need to be public.