View Single Post
  #1  
Old 06-17-2010, 02:19 PM
survivant survivant is offline
Junior Member
 
Join Date: Jun 2010
Posts: 4
Default Resin and Websocket on Atmosphere

Hello, I'm working to port Resin websocket on Atmosphere framework.

We are having few problems when we try to write response to the client.

#1 - The first problem that we had is a IllegalStateException when writting.

In Atmosphere we are doing this :

@Override
public void write(byte frame, String data) throws IOException {
context.getOutputStream().write(0x00);
context.getOutputStream().write(data.getBytes());
context.getOutputStream().write(0xff);
context.getOutputStream().flush();
}

it crash at the first line. (is it because in HttpServletRequestImpl.startWebSocket you are wrinting headers into response and it's commited before calling the onWrite ?)

#2 - On my computer the close is always call before the write method.

SocketLinkListener Thread is looking for available byte to read, and get -1 after the first read. (the first loop it reads 18 chars (in my test)).

we setted the timeout at 120 000 but in this SocketLinkListener

if (_isKeepaliveSelectEnable) {
timeout = getBlockingTimeoutForSelect();
}

overide the value to 1000.

my question is how can I skip the validation if I want to suspend the Websocket connection ?

We are testing with the Atmosphere-websocket-chat example.

if we run in debug mode.. we will be able to see the the welcome message sent by the server when we join the chat, but as soon as we resume SocketLinkListener it will get -1, and call onClose.

I hope that you can help us to put Resin on Atmosphere.

You can contact us by twitter too. @survivant or @atmo_framework

thanks
Reply With Quote