Split out socketcall processing code.