The answer depends on the protocol and whether HTTP socket is being closed by the server. If server closes the socket on you, you have no choice but to open another. In theory, you could write as many commands as you like by calling getInfos() multiple times from onConnect. Note that this only works as long as the socket remains open.