Added preliminary socket connection code.