Socket connection, model creation