refactor qconnection to qsocket