PC socket connection code