-
Notifications
You must be signed in to change notification settings - Fork 60
Grizzly doesn't seem to hold a long polling request #217
Comments
Reported by amplus@java.net |
Issue-Links: |
Was assigned to swchan2@java.net |
File: GrizzlyClient.zip |
amplus@java.net said: |
swchan2@java.net said: |
swchan2@java.net said: |
amplus@java.net said: If you take the Jetty client 6.11 from source and run it against Grizzly it does |
swchan2@java.net said: |
swchan2@java.net said:
diff MessagePool.java MessagePool.java.orig
Then I wrote a client that used Jetty 1.6.11 (see attachment) and notice the 3. The java client will fail with the following error when we invoke java.lang.IllegalStateException: unexpected end of array When I try to print the message received, I get the following: {"channel":"/meta/connect","clientId":"c36d4a0839e42ade","successful":true,"timestamp":"Mon, 11 Aug 2008 21:42:07 GMT"} , {"user":"swchan2","chat":"message 0"} ,"id":"1218491019800","clientId":"7c9af3b137e8ffe3"} Then this explains the failure. It is only a partial response. I also find that if I put a sleep of 500 ms between consecutive clients, |
File: CLClient.java |
swchan2@java.net said: |
amplus@java.net said: 2. If we send the message through the browser, then the java client do Are you doing this with the attached client against Grizzly or Jetty server? |
amplus@java.net said: However I haven't figured out why this client works but not the one I was using. |
amplus@java.net said: 1. If I do: client = new BayeuxClient(http,address,uri); and then wait for user input to tell it to subscribe, the client goes into an 2. If I do: Everything works fine. In other words, Grizzly doesn't like it if we don't subscribe right after a I also tried doing which worked fine without the connect loop. One other thing I noticed, If I do a |
Marked as cannot reproduce on Wednesday, December 16th 2009, 6:13:23 pm |
This issue was imported from java.net JIRA GRIZZLY-217 |
I’m trying to port an existing Jetty Bayeux java client to work with Grizzly.
I’m using the demo chat application since that has been ported from Jetty already.
Here is my dilemma:
When running against Jetty server the handshake connection goes something like this:
Client Server
Handshake Handshake reply successful
Connect(/meta/connect) Connect reply successful
Connect(/meta/connect) Jetty holds on to the Request -> long polling
Publish etc...
When I run the same code against Grizzly it goes like this:
Client Server
Handshake Handshake reply successful
Connect(/meta/connect) Connect reply successful
Connect(/meta/connect) Connect reply successful
Connect(/meta/connect) Connect reply successful
Etc... until the client crashes. Grizzly doesn't seem to hold on to the long
polling request.
I have tried modifying my code so that the java client stops connecting after
the first successful connect reply, then I am able to publish messages but I'm
not receiving any pushes from other clients connected to the chat since the
initial connect isn't being held by the server. I find this a bit odd since the
web based chat client works fine. Below is a copy of the conversations
Jetty client Jetty Server (working):
2008-07-23 18:58:23.864::INFO: Request: message=[{"version": "1.0",
"minimumVersion": "0.9", "channel": "/meta/handshake", "id": "0", "ext":
{"json-comment-filtered": true}}]
2008-07-23 18:58:23.083::INFO: Response:
[{"id":"0","minimumVersion":"0.9","supportedConnectionTypes":["long-polling","callback-polling"],"successful":true,"channel":"/meta/handshake","advice":
{"reconnect":"retry","interval":0,"timeout":120000}
,"clientId":"1mrrarg95sbvv8u0gg","version":"1.0"}]
2008-07-23 18:58:23.03::INFO: Request:
message=
{"channel":"/meta/connect","clientId":"1mrrarg95sbvv8u0gg","connectionType":"long-polling"}
2008-07-23 18:58:23.018::INFO: Response:
[{"successful":true,"advice":
{"reconnect":"retry","interval":0,"timeout":120000}
,"channel":"/meta/connect"}]
2008-07-23 18:58:23.018::INFO: Request:
message=
{"channel":"/meta/connect","clientId":"1mrrarg95sbvv8u0gg","connectionType":"long-polling"}
// HOLDS LONG POLLING REQUEST
2008-07-23 18:58:34.639::INFO: Request:
message=[
{"subscription":"/chat/demo","channel":"/meta/subscribe","clientId":"1mrrarg95sbvv8u0gg"}
,{"id":"1216839514703","data":
{"user":"GrizzlyClient","join":true,"chat":"GrizzlyClient has joined"}
,"channel":"/chat/demo","clientId":"1mrrarg95sbvv8u0gg"}]
2008-07-23 18:58:34.654::INFO: Response:
[
{"successful":true,"subscription":"/chat/demo","channel":"/meta/subscribe"}
,
{"id":"1216839514703","successful":true,"channel":"/chat/demo"}
,
{"id":"1216839514703","data":["GrizzlyClient"],"channel":"/chat/demo"}
,{"data":
{"chat":"GrizzlyClient has joined","join":true,"user":"GrizzlyClient"}
,"id":"1216839514703","channel":"/chat/demo"}]
2008-07-23 18:58:45.101::INFO: Request:
message=[{"id":"1216839525437","data":
{"user":"GrizzlyClient","chat":"Hello"}
,"channel":"/chat/demo","clientId":"1mrrarg95sbvv8u0gg"}]
2008-07-23 18:58:45.116::INFO: Response:
[
{"id":"1216839525437","successful":true,"channel":"/chat/demo"}
,{"data":
{"chat":"Hello","user":"GrizzlyClient"}
,"id":"1216839525437","channel":"/chat/demo"}]
2008-07-23 18:58:53.924::INFO: Request:
message=[{"id":"1216839533468","data":{"user":"GrizzlyClient","leave":true,"chat":"Grizzly
client has
2008-07-23 18:58:53.940::INFO: Response:
[
{"id":"1216839533468","successful":true,"channel":"/chat/demo"}
,{"data":
{"leave":true,"chat":"Grizzly client has left","user":"GrizzlyClient"}
,"id":"1216839533468","channel":"/chat/demo"}]
2008-07-23 18:58:53.940::INFO: Request:
message=[
{"subscription":"/chat/demo","channel":"/meta/unsubscribe","clientId":"1mrrarg95sbvv8u0gg"}
,
{"channel":"/meta/disconnect","clientId":"1mrrarg95sbvv8u0gg"}
]
2008-07-23 18:58:53.940::INFO: Response:
[
{"successful":true,"channel":"/meta/connect"}
]
Jetty client Grizzly server (not working)
2008-07-23 16:58:28.659::INFO: Request: message=[{"version": "1.0",
"minimumVersion": "0.9", "channel": "/meta/handshake", "id": "0", "ext":
{"json-comment-filtered": true}}]
2008-07-23 16:58:29.971::INFO: Response:
/*[{"channel":"/meta/handshake","version":"1.0","supportedConnectionTypes":["long-polling","callback-polling"],"minimumVersion":"0.9","id":"0","clientId":"72daf174eac043c1","successful":true,"advice":
{"reconnect":"retry","interval":0,"multiple-clients":false}
,"authSuccessful":true}]*/
2008-07-23 16:58:29.050::INFO: Request:
message=
{"channel":"/meta/connect","clientId":"72daf174eac043c1","connectionType":"long-polling"}
2008-07-23 16:58:29.050::INFO: Response:
/*[{"channel":"/meta/connect","clientId":"72daf174eac043c1","successful":true,"advice":
{"reconnect":"retry","interval":0,"multiple-clients":false}
,"timestamp":"Wed,
23 Jul 2008 16:58:29 GMT"}]*/
2008-07-23 16:58:29.050::INFO: Request:
message=
{"channel":"/meta/connect","clientId":"72daf174eac043c1","connectionType":"long-polling"}
2008-07-23 16:58:29.096::INFO: Response:
/*[{"channel":"/meta/connect","clientId":"72daf174eac043c1","successful":true,"advice":
{"reconnect":"retry","interval":0,"multiple-clients":false}
,"timestamp":"Wed,
23 Jul 2008 16:58:29 GMT"}]*/
2008-07-23 16:58:29.096::INFO: Request:
message=
{"channel":"/meta/connect","clientId":"72daf174eac043c1","connectionType":"long-polling"}
2008-07-23 16:58:29.096::INFO: Response:
/*[{"channel":"/meta/connect","clientId":"72daf174eac043c1","successful":true,"advice":
{"reconnect":"retry","interval":0,"multiple-clients":false}
,"timestamp":"Wed,
23 Jul 2008 16:58:29 GMT"}]*/
Environment
Operating System: Windows XP
Platform: PC
Affected Versions
[1.8.0]
The text was updated successfully, but these errors were encountered: