socket connection improvements.