There is some inconsistency in your posting:
This sounds like you are writing server code.
while this is clearly client code.
For a client the connect should work, i.e. the slot should be invoked when the socket establishes a connection to the server.
For a server, the client is already connected (it has connected to the server after all), so the socket is already in "connection established" state.
Cheers,
_
Bookmarks