I understand ...

The websocket handshake is a text based communication and the messages
after that a binary based.

I removed the textlinecodec filter to see my incoming messages as iobuffer
and with iobuffer.array() it works fine .

The problem is i can't pass the message object from the messageReceived
method to my other classes.
Am 18.07.2013 05:09 schrie
>
> So your using TextLineCodecFactory  and you've written some code to handle
> the server handshake?
>
> The reason you're not seeing anything meaningful with toString() is because
> the data you've received isn't text it's a websocket data frame. The only
> way toString() would show anything meaningful is if the Object "message"
> (which needn't be a String) knew how to inspect the data frame and decode
> the text (assuming it was a text data frame).
>
>
> On Wed, Jul 17, 2013 at 10:14 PM, Alexander Weber
> <[email protected]>wrote:
>
> > Yes "TEST" is my test-string.
> > I'm creating a normal websocket connection and after websocket.onopen i'm
> > using websocket.send("TEST"); that works fine with node.js as server.
> >
> > The thing is i can show the first handshake request with
> message.toString()
> > without any problems, but after sending a teststring from my
> client(chrome
> > browser) i see that a message is receives but i can't show it with
> > message.toString().
> >
> > I'm only using apache mina, nothing else.
> >
> > Greetings
> > Am 18.07.2013 02:26 schrieb "Derek Clayton" <[email protected]>:
> > >
> > > I hand decoded it and it's a valid websocket communication of the text
> > > "TEST".
> > >
> > > Are you using someone else's websocket library or trying to write your
> > own?
> > >
> > > Cheers,
> > >
> > > Derek
> > >
> > >
> > > On Wed, Jul 17, 2013 at 7:56 PM, Alexander Weber
> > > <[email protected]>wrote:
> > >
> > > > Hi,
> > > >
> > > > i'm working on a very simple websocket communication with my server.
> > > > The websocket handshake works fine, but after that my
> > client(webbrowser)
> > > > sends a message and i can see in the log that my server receives the
> > > > message ...
> > > >
> > > > INFO: RECEIVED: HeapBuffer[pos=0 lim=10 cap=2048: 81 84 18 8A E4 C7
> 4C
> > CF
> > > > B7 93]
> > > >
> > > > ... but i can't use message.toString() to show the message.
> > > >
> > > > I think my TextLineCodecFactory is filtering the message but i don't
> > know
> > > > why.
> > > >
> > > > As i said the handshake works fine and my webbrowser has a working
> > > > connection and
> > > > sending a message after the handshake.
> > > >
> > > > Can is see that unfiltered message in the buffer, to resolve my
> problem
> > ?
> > > >
> > > > greetings
> > > >
> >
>

Reply via email to