How use WebSocket with an other server

15 views
Skip to first unread message

sdne...@gmail.com

unread,
Jun 1, 2013, 1:00:42 PM6/1/13
to tu...@googlegroups.com
Hello everybody,

i search to use tufao to open a websocket with a tomcat server.

after some look to the exemples, i do something like that
[code]
connect(&websocket, SIGNAL(connected()), this, SLOT(onConnected()));
connect(&websocket, SIGNAL(disconnected()), this, SLOT(onDisconnected()));
connect(&websocket, SIGNAL(newMessage(QByteArray)),this, SLOT(onMessage(QByteArray)));
    websocket.connectToHost(QHostAddress::LocalHost, 8080, "/testecho");
[/code]

but i receive the disconnect message immediatly after the connect message.

i think i must do a startServerHandshake because i must send a http get request with upgrade method.
but i don't arrive to use it.

maybe somebody can help me


sdne...@gmail.com

unread,
Jun 2, 2013, 2:05:55 PM6/2/13
to tu...@googlegroups.com
Sorry for the post, i didn't understand that the websocker class can work in the both way(client and server).

and now it's work fine for me.

Vinícius dos Santos Oliveira

unread,
Jun 2, 2013, 2:24:29 PM6/2/13
to Tufão
2013/6/1 <sdne...@gmail.com>
Hello everybody, [...]

Welcome to the mailing list.


Sorry for the post, i didn't understand that the websocker class can work in the both way(client and server).

and now it's work fine for me.

It seems to me that Tufão documentation deserves a clearer text. I'll update it.

Thanks for the feedback.


--
Vinícius dos Santos Oliveira
Reply all
Reply to author
Forward
0 new messages