added try-catch guard around Socket.Begin*