abstract socket connection