|
Home > Archive > Apache Directory Project > November 2005 > [MINA] message delimiters.
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
[MINA] message delimiters.
|
|
| Colin Cullen 2005-11-29, 5:45 pm |
| Hi All,
I am having a little problem with my messaging. I have modeled my app similar to the way the SumUp example application works. Things work fine as long as my messages are delimited by using \r\n at the end of the message. I would like to use a different
single byte delimiter (0x03) (if possible? for compatiblity with the current client base) to end my messages, but I can't seem to get this to work (actually I don't know how to get this to work). I decided to try using my test client against both the ec
ho example and the reverser example, to see if it behaves in the same manner in this regard. Both work fine as long as I use something like this to write my message:
out = new PrintWriter(socket.getOutputStream(), true);
out.println(payload); // contains /r/n ending to msg
But if I leave off the \r\n, e.g.,
out = new PrintWriter(socket.getOutputStream(), true);
out.print(payload); // no /r/n on the print
Then both echo and reverser servers neglect to forward the message on to the rest of the framework -- which is the same behavior I get from my server.
I am using SimpleServiceRegistry to initiate the framework. I am new to NIO and I am not sure what I am missing. Could somebody point me in the right direction?
Thanks
Colin
| |
| Colin Cullen 2005-11-29, 5:45 pm |
| Forgot to mention that I am using Mina-0.8.0. -- Colin
-----Original Message-----
From: Colin Cullen <colincullen-ihVZJaRskl1bRRN4PJnoQQ@public.gmane.org>
Sent: Nov 29, 2005 6:01 PM
To: dev-aYN4UCa7k1r1N9kud6OZbmD2FQJk+8+b@public.gmane.org
Subject: [MINA] message delimiters.
Hi All,
I am having a little problem with my messaging. I have modeled my app similar to the way the SumUp example application works. Things work fine as long as my messages are delimited by using \r\n at the end of the message. I would like to use a different
single byte delimiter (0x03) (if possible? for compatiblity with the current client base) to end my messages, but I can't seem to get this to work (actually I don't know how to get this to work). I decided to try using my test client against both the ec
ho example and the reverser example, to see if it behaves in the same manner in this regard. Both work fine as long as I use something like this to write my message:
out = new PrintWriter(socket.getOutputStream(), true);
out.println(payload); // contains /r/n ending to msg
But if I leave off the \r\n, e.g.,
out = new PrintWriter(socket.getOutputStream(), true);
out.print(payload); // no /r/n on the print
Then both echo and reverser servers neglect to forward the message on to the rest of the framework -- which is the same behavior I get from my server.
I am using SimpleServiceRegistry to initiate the framework. I am new to NIO and I am not sure what I am missing. Could somebody point me in the right direction?
Thanks
Colin
| |
| Colin Cullen 2005-11-29, 5:45 pm |
| Ok, seems to do what I want if I ad a flush to the stream -- I thought is would autoflush considering the PrintWriter constructor.
out = new PrintWriter(socket.getOutputStream(), true);
out.print(payload); // no /r/n on the print
out.flush();
-----Original Message-----
From: Colin Cullen <colincullen-ihVZJaRskl1bRRN4PJnoQQ@public.gmane.org>
Sent: Nov 29, 2005 6:15 PM
To: Apache Directory Developers List <dev-aYN4UCa7k1r1N9kud6OZbmD2FQJk+8+b@public.gmane.org>, Colin Cullen <colincullen-ihVZJaRskl1bRRN4PJnoQQ@public.gmane.org>
Subject: Re: [MINA] message delimiters.
Forgot to mention that I am using Mina-0.8.0. -- Colin
-----Original Message-----
From: Colin Cullen <colincullen-ihVZJaRskl1bRRN4PJnoQQ@public.gmane.org>
Sent: Nov 29, 2005 6:01 PM
To: dev-aYN4UCa7k1r1N9kud6OZbmD2FQJk+8+b@public.gmane.org
Subject: [MINA] message delimiters.
Hi All,
I am having a little problem with my messaging. I have modeled my app similar to the way the SumUp example application works. Things work fine as long as my messages are delimited by using \r\n at the end of the message. I would like to use a different
single byte delimiter (0x03) (if possible? for compatiblity with the current client base) to end my messages, but I can't seem to get this to work (actually I don't know how to get this to work). I decided to try using my test client against both the ec
ho example and the reverser example, to see if it behaves in the same manner in this regard. Both work fine as long as I use something like this to write my message:
out = new PrintWriter(socket.getOutputStream(), true);
out.println(payload); // contains /r/n ending to msg
But if I leave off the \r\n, e.g.,
out = new PrintWriter(socket.getOutputStream(), true);
out.print(payload); // no /r/n on the print
Then both echo and reverser servers neglect to forward the message on to the rest of the framework -- which is the same behavior I get from my server.
I am using SimpleServiceRegistry to initiate the framework. I am new to NIO and I am not sure what I am missing. Could somebody point me in the right direction?
Thanks
Colin
|
|
|
|
|