Multiple connection socket function