<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:n2.nabble.com,2006:forum-685700</id>
	<title>Nabble - Netty User Group</title>
	<updated>2009-01-08T22:50:07Z</updated>
	<link rel="self" type="application/atom+xml" href="http://n2.nabble.com/Netty-User-Group-f685700.xml" />
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Netty-User-Group-f685700.html" />
	<subtitle type="html">End user questions and answers are posted here.</subtitle>
	
<entry>
	<id>tag:n2.nabble.com,2006:post-2132041</id>
	<title>A P2P-like network?</title>
	<published>2009-01-08T22:50:07Z</published>
	<updated>2009-01-08T22:50:07Z</updated>
	<author>
		<name>dongnod</name>
	</author>
	<content type="html">Hi all,
&lt;br&gt;&lt;br&gt;My project requires to build a P2P-like network, and I just came across Netty today and it looks very interesting. &amp;nbsp;I'd need some help on how to best use Netty to implement it. &amp;nbsp;The following are some key requirements:
&lt;br&gt;1. The actors on the network consists of a leader and some workers
&lt;br&gt;2. Normally, all actors exchange messages asynchronously to each other (also a worker to some other worker too)
&lt;br&gt;3. Occasionally, the leader may initiate a synchronization call, in which all actors wait until all the messages are received, then all workers stop processing and become idle, then the leader continues with normal operations (such as 2.)
&lt;br&gt;&lt;br&gt;I am a bit puzzled on how to do 3., it'd be great if someone could shed some light on this!
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;DongnoD.
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/A-P2P-like-network--tp2132041p2132041.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2120341</id>
	<title>Re: New to Netty - Basic simple questions</title>
	<published>2009-01-06T17:15:42Z</published>
	<updated>2009-01-06T17:15:42Z</updated>
	<author>
		<name>Trustin Lee-3</name>
	</author>
	<content type="html">Hi,&lt;br&gt;&lt;br&gt;First off, welcome! :)&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Jan 7, 2009 at 6:34 AM, new2nw &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2120341&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;makunag@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
The code is based totally on factorial example. And here are my dumb&lt;br&gt;
questions:&lt;br&gt;
&lt;br&gt;
How do I handle netty client?&lt;br&gt;
&lt;br&gt;
1. For each request(thread) out of my process do I need to create a new&lt;br&gt;
channel (I mean create a new connection) as in the example above? Or shall I&lt;br&gt;
be using the same channel by not closing it and continue to write on it?&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;You can keep the channel open and keep sending requests.&amp;nbsp; Of course, you can open and close a connection for each request, too.&lt;br&gt;
&amp;nbsp;&lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;2. If I create a new connection for each request; is there a performance&lt;br&gt;
issue?&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;Yes.&amp;nbsp; You will see a lot of TIME_WAIT state if you type &amp;#39;netstat -an&amp;#39; in your console.&amp;nbsp; If the number of TIME_WAIT state fills up, the channel will not be opened as fast as before until TIME_WAIT states are cleared.&amp;nbsp; I&amp;#39;d recommend you to keep the connection open and reconnect only when it&amp;#39;s disconnected for some reason.&lt;br&gt;
&amp;nbsp;&lt;br&gt;&lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;3. If I create a new connection for each request; shall I use same channel&lt;br&gt;
factory ?&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;Yes.&amp;nbsp; I&amp;#39;d actually use only one channel factory to create all channels.&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
4. If I can reuse same connection, how do I match request with response? Do&lt;br&gt;
I have to have my own logic?&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;There are two ways to achieve this.&amp;nbsp; The first approach is to assume that the responses are always responded in order.&amp;nbsp; Then you can safely assume that the first response is always correlates to the first request and so forth.&amp;nbsp; The second approach is to add some sequence ID for each request and convey the same sequence ID for the corresponding response.&amp;nbsp; The second approach is more flexible but you might be just fine with the first one.&lt;br&gt;
&lt;br&gt;&lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;5. In the above example using blocking queue and &amp;quot;one&amp;quot; as channel pipelien&lt;br&gt;

coverage, am I guranteed to receive the response corresponding to my&lt;br&gt;
request, or I have to look at the response and decide if its the right&lt;br&gt;
response?&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;ChannelPipelineCoverage is solely for documentation purpose.&amp;nbsp; It just depends on how many handler instances you create to handler events.&amp;nbsp; If you added the same handler instance for more than one ChannelPipeline, then you will receive all responses from all channels in one handler instance.&amp;nbsp; If you added a new handler for each Channel, then each handler instance will receive the response which is related with the Channel it belongs to.&amp;nbsp; &lt;br&gt;
&amp;nbsp;&lt;br&gt;&lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;6. Is this an asynchronus process? I am confused as each request is waiting&lt;br&gt;
for response (synch) but at the same time each requests doesn&amp;#39;t have to wait&lt;br&gt;
for the other to finish as netty server will keep receiving requests from&lt;br&gt;
each channels.&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;Everything is asynchronous.&amp;nbsp; The Factorial client is synchronous because it explicitly waits for a response using a blocking queue.&lt;br&gt;&amp;nbsp;&lt;/div&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
7. Am I missing something important in the above example code.&lt;/blockquote&gt;&lt;div&gt;&lt;br&gt;I think you understood pretty well about Netty.&amp;nbsp; :)&lt;br&gt;&lt;br&gt;You might want to add an ExecutionHandler to the pipeline though.&amp;nbsp; Please take a look at the Javadoc of the classes in org.jboss.netty.handler.execution.&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;br&gt;HTH,&lt;br&gt;&lt;br&gt;— Trustin Lee, &lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2120341&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/New-to-Netty---Basic-simple-questions-tp2119529p2120341.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2119529</id>
	<title>New to Netty - Basic simple questions</title>
	<published>2009-01-06T13:34:57Z</published>
	<updated>2009-01-06T13:34:57Z</updated>
	<author>
		<name>new2nw</name>
	</author>
	<content type="html">I am new to netty, new to N/W programming. So forgive me if I am asking fairly simple and dumb questions. 
&lt;br&gt;&lt;br&gt;I have a multi threaded process (kind of server) which receives multiple requests at a time, I do some processing with each request and then my requirement is to pass the request to a remote process (using netty) and get the response back corresponding to each request. All should happen in asynchronus fashion, but at the same time all response should match the corresponding request.
&lt;br&gt;&lt;br&gt;Using factorial example, I have created a netty server which will bind and accept incoming connection. I created a server handler which will on messageReceived() read the message, do some business logic and write back the corresponding response to channel. The channel pipeline coverage for this handler is &amp;quot;all&amp;quot;. I have also created server pipeline factory which will add encoder, decoder and my server handler to pipeline. I start(bind) my netty server and keep it running(listening). 
&lt;br&gt;&lt;br&gt;On client side, I have created a netty client which connects to the netty server, await and get a channel back. Then I write to the channel, await and get client handler back. Using client handler's getResponse() method I get my response back and pass it to my process. I created a client handler which has a blocking queue as instance variable. on messagereceived() I write to blocking queue after closing the channel. On getResponse() method; I take the message from blocking queue and return. The channel pipeline coverage for this handler is &amp;quot;one&amp;quot;. I have also created client pipeline factory which will add encoder, decoder and my client handler to pipeline.
&lt;br&gt;&lt;br&gt;The code is based totally on factorial example. And here are my dumb questions: 
&lt;br&gt;&lt;br&gt;&amp;nbsp;How do I handle netty client? 
&lt;br&gt;&lt;br&gt;1. For each request(thread) out of my process do I need to create a new channel (I mean create a new connection) as in the example above? Or shall I be using the same channel by not closing it and continue to write on it?
&lt;br&gt;&lt;br&gt;2. If I create a new connection for each request; is there a performance issue?
&lt;br&gt;&lt;br&gt;3. If I create a new connection for each request; shall I use same channel factory ?
&lt;br&gt;&lt;br&gt;4. If I can reuse same connection, how do I match request with response? Do I have to have my own logic? 
&lt;br&gt;&lt;br&gt;5. In the above example using blocking queue and &amp;quot;one&amp;quot; as channel pipelien coverage, am I guranteed to receive the response corresponding to my request, or I have to look at the response and decide if its the right response?
&lt;br&gt;&lt;br&gt;6. Is this an asynchronus process? I am confused as each request is waiting for response (synch) but at the same time each requests doesn't have to wait for the other to finish as netty server will keep receiving requests from each channels.
&lt;br&gt;&lt;br&gt;7. Am I missing something important in the above example code.
&lt;br&gt;&lt;br&gt;Many thanks is advance !</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/New-to-Netty---Basic-simple-questions-tp2119529p2119529.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2115872</id>
	<title>Re: Progress of request sent</title>
	<published>2009-01-05T17:44:53Z</published>
	<updated>2009-01-05T17:44:53Z</updated>
	<author>
		<name>Trustin Lee</name>
	</author>
	<content type="html">If you are sending a large file in one shot, you are likely to hit OutOfMemoryError.&amp;nbsp; Therefore, assuming that you are sending a file split into multiple chunks with a certain size (e.g. 8192 bytes), you can add a ChannelFutureListener to the ChannelFuture that is returned by the write operation for each chunk.&lt;br&gt;
&lt;br&gt;— Trustin Lee, &lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Jan 1, 2009 at 1:35 AM, manish_iitg &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2115872&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;excellencetechnologies08@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
&lt;br&gt;
I am developing a file upload server, so when a user uploads a file from the&lt;br&gt;
client, i want to show a progress bar for the file upload. Is there any way&lt;br&gt;
to do that.&lt;br&gt;
&lt;br&gt;
Is there anyway to know the amount of bytes that are sent from the client to&lt;br&gt;
server. Meaning, to track the progress.&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;--&lt;br&gt;
View this message in context: &lt;a href=&quot;http://n2.nabble.com/Progress-of-request-sent-tp2096502p2096502.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Progress-of-request-sent-tp2096502p2096502.html&lt;/a&gt;&lt;br&gt;
Sent from the Netty User Group mailing list archive at Nabble.com.&lt;br&gt;
&lt;br&gt;
_______________________________________________&lt;br&gt;
netty-users mailing list&lt;br&gt;
&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2115872&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2115872&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;signature&quot;&gt;Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
&lt;br&gt;--
&lt;br&gt;what we call human nature is actually human habit
&lt;br&gt;--
&lt;br&gt;&lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Progress-of-request-sent-tp2096502p2115872.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2096502</id>
	<title>Progress of request sent</title>
	<published>2008-12-31T08:35:04Z</published>
	<updated>2008-12-31T08:35:04Z</updated>
	<author>
		<name>manish_iitg</name>
	</author>
	<content type="html">I am developing a file upload server, so when a user uploads a file from the client, i want to show a progress bar for the file upload. Is there any way to do that.
&lt;br&gt;&lt;br&gt;Is there anyway to know the amount of bytes that are sent from the client to server. Meaning, to track the progress.</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Progress-of-request-sent-tp2096502p2096502.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2096390</id>
	<title>Re: Happy New Year</title>
	<published>2008-12-31T07:47:10Z</published>
	<updated>2008-12-31T07:47:10Z</updated>
	<author>
		<name>Trustin Lee-3</name>
	</author>
	<content type="html">Hey, thanks for the new year&amp;#39;s greeting!&amp;nbsp; Thank you for your continuous interest in Netty, and happy new 2009!&lt;br&gt;&lt;br&gt;Cheers,&lt;br&gt;Trustin&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Dec 31, 2008 at 9:36 PM, manish_iitg &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2096390&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;excellencetechnologies08@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Happy New Year to all.... :)&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;-- &lt;br&gt;Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat&lt;br&gt;--&lt;br&gt;what we call human nature in actuality is human habit&lt;br&gt;--&lt;br&gt;&lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;

&lt;br /&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2096390&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Happy-New-Year-tp2095928p2096390.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2095928</id>
	<title>Happy New Year</title>
	<published>2008-12-31T04:36:59Z</published>
	<updated>2008-12-31T04:36:59Z</updated>
	<author>
		<name>manish_iitg</name>
	</author>
	<content type="html">Happy New Year to all.... :)</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Happy-New-Year-tp2095928p2095928.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2096531</id>
	<title>Re: SimpleChannelHander query</title>
	<published>2008-12-31T08:41:43Z</published>
	<updated>2008-12-31T08:41:43Z</updated>
	<author>
		<name>Trustin Lee-3</name>
	</author>
	<content type="html">It&amp;#39;s a static import.&amp;nbsp; See Channels.pipeline()&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;— Trustin Lee, &lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Jan 1, 2009 at 1:17 AM, manish_iitg &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2096531&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;excellencetechnologies08@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
&lt;br&gt;
In the below code, from the netty examples.&lt;br&gt;
In line 43 it calls a funciton pipeline();&lt;br&gt;
what function is this and in which class is this defined.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
public class FactorialServerPipelineFactory implements&lt;br&gt;
40 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ChannelPipelineFactory {&lt;br&gt;
41&lt;br&gt;
42 &amp;nbsp; &amp;nbsp; &amp;nbsp;public ChannelPipeline getPipeline() throws Exception {&lt;br&gt;
43 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ChannelPipeline pipeline = pipeline();&lt;br&gt;
44&lt;br&gt;
45 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Add the number codec first,&lt;br&gt;
46 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pipeline.addLast(&amp;quot;decoder&amp;quot;, new BigIntegerDecoder());&lt;br&gt;
47 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pipeline.addLast(&amp;quot;encoder&amp;quot;, new NumberEncoder());&lt;br&gt;
48&lt;br&gt;
49 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// and then business logic.&lt;br&gt;
50 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Please note we create a handler for every new channel&lt;br&gt;
51 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// because it has stateful properties.&lt;br&gt;
52 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;pipeline.addLast(&amp;quot;handler&amp;quot;, new FactorialServerHandler());&lt;br&gt;
53&lt;br&gt;
54 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return pipeline;&lt;br&gt;
55 &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;br&gt;
56 &amp;nbsp;}&lt;br&gt;
&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;Wj3C7c&quot;&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
Trustin Lee-3 wrote:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I&amp;#39;m not sure I understood your question correctly, but here&amp;#39;s my answer.&lt;br&gt;
&amp;gt; :-)&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Even if you have specified ChannelPipelineCoverage as &amp;quot;one&amp;quot;, it doesn&amp;#39;t&lt;br&gt;
&amp;gt; necessarily mean that a new ChannelHandler instance will be created for&lt;br&gt;
&amp;gt; each&lt;br&gt;
&amp;gt; Channel automatically. &amp;nbsp;You need to create it by yourself in your&lt;br&gt;
&amp;gt; ChannelPipelineFactory. &amp;nbsp;Please refer to the Factorial example:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;nbsp; &amp;nbsp;- &lt;a href=&quot;http://tinyurl.com/6wgwtd&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://tinyurl.com/6wgwtd&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; HTH,&lt;br&gt;
&amp;gt; Trustin*&lt;br&gt;
&amp;gt; *&lt;br&gt;
&amp;gt; On Tue, Dec 30, 2008 at 8:26 PM, manish_iitg &amp;lt;&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2096531&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;excellencetechnologies08@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&amp;gt; I have ChannelPipelineCoverage as &amp;quot;one&amp;quot; in my for my server handler. Even&lt;br&gt;
&amp;gt;&amp;gt; then after i close my connection from the client by called&lt;br&gt;
&amp;gt;&amp;gt; e.getChannl().close() and then after some time again start a connection&lt;br&gt;
&amp;gt;&amp;gt; by&lt;br&gt;
&amp;gt;&amp;gt; bind to the server, a new instance of server handler is not create.&lt;br&gt;
&amp;gt;&amp;gt; Please&lt;br&gt;
&amp;gt;&amp;gt; tell my what i am doing wrong. What i want is that, when a client&lt;br&gt;
&amp;gt;&amp;gt; connects&lt;br&gt;
&amp;gt;&amp;gt; to the server a new server handler should be created.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; --&lt;br&gt;
&amp;gt; Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat&lt;br&gt;
&amp;gt; --&lt;br&gt;
&amp;gt; what we call human nature in actuality is human habit&lt;br&gt;
&amp;gt; --&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;div class=&quot;Ih2E3d&quot;&gt;&amp;gt; _______________________________________________&lt;br&gt;
&amp;gt; netty-users mailing list&lt;br&gt;
&amp;gt; &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2096531&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;&lt;br&gt;
&amp;gt; &lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;font color=&quot;#888888&quot;&gt;--&lt;br&gt;
View this message in context: &lt;a href=&quot;http://n2.nabble.com/SimpleChannelHander-query-tp2092051p2096456.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/SimpleChannelHander-query-tp2092051p2096456.html&lt;/a&gt;&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;Wj3C7c&quot;&gt;Sent from the Netty User Group mailing list archive at Nabble.com.&lt;br&gt;
&lt;br&gt;
_______________________________________________&lt;br&gt;
netty-users mailing list&lt;br&gt;
&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2096531&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2096531&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/SimpleChannelHander-query-tp2092051p2096531.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2096495</id>
	<title>Re: SimpleChannelHander query</title>
	<published>2008-12-31T08:32:43Z</published>
	<updated>2008-12-31T08:32:43Z</updated>
	<author>
		<name>manish_iitg</name>
	</author>
	<content type="html">Thanks, this answers my question.
&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;Trustin Lee-3 wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;I'm not sure I understood your question correctly, but here's my answer. :-)
&lt;br&gt;&lt;br&gt;Even if you have specified ChannelPipelineCoverage as &amp;quot;one&amp;quot;, it doesn't
&lt;br&gt;necessarily mean that a new ChannelHandler instance will be created for each
&lt;br&gt;Channel automatically. &amp;nbsp;You need to create it by yourself in your
&lt;br&gt;ChannelPipelineFactory. &amp;nbsp;Please refer to the Factorial example:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp;- &lt;a href=&quot;http://tinyurl.com/6wgwtd&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tinyurl.com/6wgwtd&lt;/a&gt;&lt;br&gt;&lt;br&gt;HTH,
&lt;br&gt;Trustin*
&lt;br&gt;*
&lt;br&gt;On Tue, Dec 30, 2008 at 8:26 PM, manish_iitg &amp;lt;
&lt;br&gt;excellencetechnologies08@gmail.com&amp;gt; wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; I have ChannelPipelineCoverage as &amp;quot;one&amp;quot; in my for my server handler. Even
&lt;br&gt;&amp;gt; then after i close my connection from the client by called
&lt;br&gt;&amp;gt; e.getChannl().close() and then after some time again start a connection by
&lt;br&gt;&amp;gt; bind to the server, a new instance of server handler is not create. Please
&lt;br&gt;&amp;gt; tell my what i am doing wrong. What i want is that, when a client connects
&lt;br&gt;&amp;gt; to the server a new server handler should be created.
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
&lt;br&gt;--
&lt;br&gt;what we call human nature in actuality is human habit
&lt;br&gt;--
&lt;br&gt;&lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;netty-users@lists.jboss.org
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/SimpleChannelHander-query-tp2092051p2096495.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2096402</id>
	<title>Re: SimpleChannelHander query</title>
	<published>2008-12-31T07:51:17Z</published>
	<updated>2008-12-31T07:51:17Z</updated>
	<author>
		<name>Trustin Lee-3</name>
	</author>
	<content type="html">I&amp;#39;m not sure I understood your question correctly, but here&amp;#39;s my answer. :-)&lt;br&gt;&lt;br&gt;Even if you have specified ChannelPipelineCoverage as &amp;quot;one&amp;quot;, it doesn&amp;#39;t necessarily mean that a new ChannelHandler instance will be created for each Channel automatically.&amp;nbsp; You need to create it by yourself in your ChannelPipelineFactory.&amp;nbsp; Please refer to the Factorial example:&lt;br&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href=&quot;http://tinyurl.com/6wgwtd&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tinyurl.com/6wgwtd&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;HTH,&lt;br&gt;Trustin&lt;b&gt;&lt;br&gt;&lt;/b&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Tue, Dec 30, 2008 at 8:26 PM, manish_iitg &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2096402&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;excellencetechnologies08@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
I have ChannelPipelineCoverage as &amp;quot;one&amp;quot; in my for my server handler. Even&lt;br&gt;
then after i close my connection from the client by called&lt;br&gt;
e.getChannl().close() and then after some time again start a connection by&lt;br&gt;
bind to the server, a new instance of server handler is not create. Please&lt;br&gt;
tell my what i am doing wrong. What i want is that, when a client connects&lt;br&gt;
to the server a new server handler should be created.&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;-- &lt;br&gt;Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat&lt;br&gt;--&lt;br&gt;what we call human nature in actuality is human habit&lt;br&gt;
--&lt;br&gt;&lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2096402&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/SimpleChannelHander-query-tp2092051p2096402.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2092051</id>
	<title>SimpleChannelHander query</title>
	<published>2008-12-30T03:26:50Z</published>
	<updated>2008-12-30T03:26:50Z</updated>
	<author>
		<name>manish_iitg</name>
	</author>
	<content type="html">I have ChannelPipelineCoverage as &amp;quot;one&amp;quot; in my for my server handler. Even then after i close my connection from the client by called e.getChannl().close() and then after some time again start a connection by bind to the server, a new instance of server handler is not create. Please tell my what i am doing wrong. What i want is that, when a client connects to the server a new server handler should be created.</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/SimpleChannelHander-query-tp2092051p2092051.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2115880</id>
	<title>Re: documentation tips</title>
	<published>2009-01-05T17:46:56Z</published>
	<updated>2009-01-05T17:46:56Z</updated>
	<author>
		<name>Trustin Lee-3</name>
	</author>
	<content type="html">Hi Richard,&lt;br&gt;&lt;br&gt;Thanks for sharing the information about your project.&amp;nbsp; Please keep us updated with your progress and your findings with Netty so that we can address any issues that you might encounter. :)&lt;br&gt;&lt;br&gt;Cheers,&lt;br clear=&quot;all&quot;&gt;
&lt;br&gt;— Trustin Lee, &lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Jan 1, 2009 at 3:06 PM, Richard Jackson &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2115880&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;richard.jackson@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Thought I would let you know I just added my project that I&amp;#39;m getting&lt;br&gt;
ready to start work on that will use Netty for both the client and&lt;br&gt;
server side of things. Not much on the project site for now but give&lt;br&gt;
me some time and there will be.&lt;br&gt;
&lt;br&gt;
As stated in the JIRA issue I&amp;#39;m going to implement the OSGi&lt;br&gt;
HTTPService specification using Netty. Currently I plan on supporting&lt;br&gt;
as Much of the servlet 2.5 spec as I can (Some things just don&amp;#39;t work&lt;br&gt;
the same in the OSGi environment so some things will not be&lt;br&gt;
implemented the same as in say Tomcat). I have actually already&lt;br&gt;
started this project multiple times but have ran into issues with the&lt;br&gt;
other frameworks I have tried to do this with. After looking over the&lt;br&gt;
docs for netty it really looks like it will finally be the framework&lt;br&gt;
that will get the job done :) Plus seems to have some added benefits&lt;br&gt;
that I&amp;#39;m looking forward to playing with.&lt;br&gt;
&lt;br&gt;
Richard&lt;br&gt;
_______________________________________________&lt;br&gt;
netty-users mailing list&lt;br&gt;
&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2115880&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2115880&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/documentation-tips-tp2089736p2115880.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2098254</id>
	<title>Re: documentation tips</title>
	<published>2008-12-31T22:06:38Z</published>
	<updated>2008-12-31T22:06:38Z</updated>
	<author>
		<name>Richard Jackson</name>
	</author>
	<content type="html">Thought I would let you know I just added my project that I'm getting
&lt;br&gt;ready to start work on that will use Netty for both the client and
&lt;br&gt;server side of things. Not much on the project site for now but give
&lt;br&gt;me some time and there will be.
&lt;br&gt;&lt;br&gt;As stated in the JIRA issue I'm going to implement the OSGi
&lt;br&gt;HTTPService specification using Netty. Currently I plan on supporting
&lt;br&gt;as Much of the servlet 2.5 spec as I can (Some things just don't work
&lt;br&gt;the same in the OSGi environment so some things will not be
&lt;br&gt;implemented the same as in say Tomcat). I have actually already
&lt;br&gt;started this project multiple times but have ran into issues with the
&lt;br&gt;other frameworks I have tried to do this with. After looking over the
&lt;br&gt;docs for netty it really looks like it will finally be the framework
&lt;br&gt;that will get the job done :) Plus seems to have some added benefits
&lt;br&gt;that I'm looking forward to playing with.
&lt;br&gt;&lt;br&gt;Richard
&lt;br&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2098254&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/documentation-tips-tp2089736p2098254.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2095110</id>
	<title>Re: documentation tips</title>
	<published>2008-12-30T21:13:41Z</published>
	<updated>2008-12-30T21:13:41Z</updated>
	<author>
		<name>Trustin Lee-3</name>
	</author>
	<content type="html">Hi Marian,
&lt;br&gt;&lt;br&gt;Thanks for your suggestion first of all!
&lt;br&gt;&lt;br&gt;On Tue, Dec 30, 2008 at 3:27 AM, Marian Stranecky
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2095110&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marian.stranecky@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; That's me again :)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I would like to share some ideas with you about what else should be yet
&lt;br&gt;&amp;gt; documented a little bit more:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; - InterestOps and related getInterestOps() method - what is use case and how
&lt;br&gt;&amp;gt; is it related to a &amp;quot;connection&amp;quot; lifecycle?
&lt;br&gt;&lt;br&gt;That's an interesting question. &amp;nbsp;For TCP/IP transport, it works only
&lt;br&gt;when a channel is 'connected'. &amp;nbsp;ServerSocketChannel doesn't support
&lt;br&gt;interestOps and you will get UnsupportedOperationException IIRC.
&lt;br&gt;&lt;br&gt;&amp;gt; - links to projects using Netty (I don't think Netty is just a startup so I
&lt;br&gt;&amp;gt; am wondering if there are any more complex projects from which we can study
&lt;br&gt;&amp;gt; more)
&lt;br&gt;&lt;br&gt;Good idea! &amp;nbsp;Let me update the web site when I have a chance.
&lt;br&gt;Meanwhile, let me file a JIRA issue:
&lt;br&gt;&lt;br&gt;&amp;nbsp; * &lt;a href=&quot;https://jira.jboss.org/jira/browse/NETTY-99&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://jira.jboss.org/jira/browse/NETTY-99&lt;/a&gt;&lt;br&gt;&lt;br&gt;Please feel free to post a comment if you have launched an open source
&lt;br&gt;project that depends on Netty. ;)
&lt;br&gt;&lt;br&gt;&amp;gt; - donwload links for wiki contributed examples so they can be downloaded and
&lt;br&gt;&amp;gt; used (compiled and tried) very quickly (in best case I suppose use of maven,
&lt;br&gt;&amp;gt; ant or Ivy?)
&lt;br&gt;&lt;br&gt;That's also a good idea. &amp;nbsp;Any contribution is appreciated. ;)
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; building a more complex client side example of &amp;quot;resource adaptor&amp;quot; which
&lt;br&gt;&amp;gt; efficiently polls a source of messages (e.g. db), encodes it and sends while
&lt;br&gt;&amp;gt; receives from remote side asynchronously. This example should be able to
&lt;br&gt;&amp;gt; show some hints and basic use of:
&lt;br&gt;&amp;gt; - multithreading (message poll and sender workers)
&lt;br&gt;&amp;gt; - management (e.g. watchdog or jmx)
&lt;br&gt;&amp;gt; - message buffering with a blocking queue
&lt;br&gt;&amp;gt; - possibly reconnecting (or repeatedly calling a connect())
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The above stated issues are the ones I am trying to solve right now. In case
&lt;br&gt;&amp;gt; I reach success I will share it with you. But maybe there is a work done
&lt;br&gt;&amp;gt; already?
&lt;/div&gt;&lt;br&gt;You're right. &amp;nbsp;Except for JMX, all of them are doable with Netty, but
&lt;br&gt;needs documentation to help quick start.
&lt;br&gt;&lt;br&gt;&amp;gt; I would also appreciate proper information in examples and posts about which
&lt;br&gt;&amp;gt; netty version is used (can we make it a rule?)
&lt;br&gt;&lt;br&gt;All examples depend on the latest stable release unless specified
&lt;br&gt;explicitly. &amp;nbsp;For example, HTTP example requires 3.1, which is not a
&lt;br&gt;stable release yet. &amp;nbsp;If 3.1.0.GA is released, all examples should be
&lt;br&gt;updated to depend on 3.1.0.GA.
&lt;br&gt;&lt;br&gt;HTH,
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
&lt;br&gt;--
&lt;br&gt;what we call human nature in actuality is human habit
&lt;br&gt;--
&lt;br&gt;&lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2095110&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/documentation-tips-tp2089736p2095110.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2089736</id>
	<title>documentation tips</title>
	<published>2008-12-29T10:27:57Z</published>
	<updated>2008-12-29T10:27:57Z</updated>
	<author>
		<name>marmax</name>
	</author>
	<content type="html">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;Hi,&lt;br&gt;
That's me again :)&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;I would like to share some ideas with you about what else should be yet documented a little bit more:&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;- InterestOps and related getInterestOps() method - what is use case and how is it related to a &quot;connection&quot; lifecycle?&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;- links to projects using Netty (I don't think Netty is just a startup so I am wondering if there are any more complex projects from which we can study more)&lt;br&gt;
-  donwload links for wiki contributed examples so they can be downloaded and used (compiled and tried) very quickly (in best case  I suppose use of maven, ant or Ivy?)&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;building a more complex client side example of &quot;resource adaptor&quot; which efficiently polls a source of messages (e.g. db), encodes it and sends while receives from remote side asynchronously. This example should be able to show some hints and basic use of:&lt;br&gt;
- multithreading (message poll and sender workers)&lt;br&gt;
- management (e.g. watchdog or jmx)&lt;br&gt;
- message buffering with a blocking queue&lt;br&gt;
- possibly reconnecting (or repeatedly calling a connect())&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;The above stated issues are the ones I am trying to solve right now. In case I reach success I will share it with you. But maybe there is a work done already?&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;I would also appreciate proper information in examples and posts about which netty version is used (can we make it a rule?)&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;Cheers,&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;Marian&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2089736&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/documentation-tips-tp2089736p2089736.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2091788</id>
	<title>Re: ExecutionHandler problem</title>
	<published>2008-12-30T01:26:45Z</published>
	<updated>2008-12-30T01:26:45Z</updated>
	<author>
		<name>marmax</name>
	</author>
	<content type="html">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;Thanks for your answer, Trustin.&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;I was just wondering if there is a more generic way to handle this. IMHO when there is an institute of ExecutionHandler we should be able to shutdown it transparently (e.g. by signaling somewhere in the pipeline).&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;Anyway, as far as I see, it should be handled now by this piece of code in &quot;client&quot; (to avoid pushing a referable instance of an Executor to the PipelineFactory):&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;	        ExecutionHandler execHandler = (ExecutionHandler) channel.getPipeline().get(&quot;executor&quot;);&lt;br&gt;
	        ExecutorService es = (ExecutorService) execHandler.getExecutor();&lt;br&gt;
	        es.shutdown();&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;Am I right?&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;TIA,&lt;br&gt;
Marian&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;On Tuesday 30 of December 2008 07:48:48 Trustin Lee wrote:&lt;br&gt;
&amp;gt; Hi Marian,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; You need to shut down the OrderedMemoryAwareThreadPoolExecutor that&lt;br&gt;
&amp;gt; you've created by yourself.  ChannelFactory.releaseExternalResources()&lt;br&gt;
&amp;gt; will not shut down the Executor that is used by ExecutionHandler.&lt;br&gt;
&amp;gt; Please call OrderedMemoryAwareThreadPoolExecutor.shutdown() after&lt;br&gt;
&amp;gt; calling ChannelFactory.releaseExternalResources(), then everything&lt;br&gt;
&amp;gt; should be cleaned up.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; HTH,&lt;br&gt;
&amp;gt; Trustin&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; On Tue, Dec 30, 2008 at 2:09 AM, Marian Stranecky&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; &amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2091788&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marian.stranecky@...&lt;/a&gt;&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; Hi all,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I would like to ask you for information of how to connect and shutdown&lt;br&gt;
&amp;gt; &amp;gt; the client properly, because I have experienced a problem with netty&lt;br&gt;
&amp;gt; &amp;gt; while trying to use an ExecutionHandler:&lt;br&gt;
&amp;gt; &amp;gt; The threads created in OrderedMemoryAwareThreadPoolExecutor and used in&lt;br&gt;
&amp;gt; &amp;gt; handling are running even after the channel is closed (e.g. closed by a&lt;br&gt;
&amp;gt; &amp;gt; server after the channel is marked idle)&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Thanks in advance,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Marian&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; public ChannelPipeline getPipeline() throws Exception {&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; ChannelPipeline pipeline = pipeline();&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; // Add the number codec first,&lt;br&gt;
&amp;gt; &amp;gt; pipeline.addLast(&quot;decoder&quot;, new MyMessageDecoder());&lt;br&gt;
&amp;gt; &amp;gt; pipeline.addLast(&quot;encoder&quot;, new MyMessageEncoder());&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; // utilize the processing&lt;br&gt;
&amp;gt; &amp;gt; // pipeline.addLast(&quot;executor&quot;, new ExecutionHandler(new&lt;br&gt;
&amp;gt; &amp;gt; OrderedMemoryAwareThreadPoolExecutor(16, 1048576, 1048576)));&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; // and then business logic.&lt;br&gt;
&amp;gt; &amp;gt; pipeline.addLast(&quot;handler&quot;, new OISDClientHandler(this.client));&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; return pipeline;&lt;br&gt;
&amp;gt; &amp;gt; }&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; The client is as follows:&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; public void connect(){&lt;br&gt;
&amp;gt; &amp;gt; ExecutorService bossExecutor = Executors.newCachedThreadPool(new&lt;br&gt;
&amp;gt; &amp;gt; CustomThreadFactory(&quot;bossExecutorPool&quot;));&lt;br&gt;
&amp;gt; &amp;gt; ExecutorService workerExecutor = Executors.newCachedThreadPool(new&lt;br&gt;
&amp;gt; &amp;gt; CustomThreadFactory(&quot;workerExecutorPool&quot;));&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; ChannelFactory factory = new NioClientSocketChannelFactory(bossExecutor,&lt;br&gt;
&amp;gt; &amp;gt; workerExecutor);&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; ClientBootstrap bootstrap = new ClientBootstrap(factory);&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; bootstrap.setPipelineFactory(new OISDClientPipelineFactory(this));&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; HashMap&amp;lt;String, Object&amp;gt; opts = new HashMap&amp;lt;String, Object&amp;gt;();&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; opts.put(&quot;tcpNoDelay&quot;, false);&lt;br&gt;
&amp;gt; &amp;gt; opts.put(&quot;keepAlive&quot;, true);&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; bootstrap.setOptions(opts);&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; ChannelFuture connectFuture = bootstrap.connect(this.SMSCAddress);&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; // Wait until the connection attempt succeeds or fails.&lt;br&gt;
&amp;gt; &amp;gt; this.channel = connectFuture.awaitUninterruptibly().getChannel();&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; if (!connectFuture.isSuccess()) {&lt;br&gt;
&amp;gt; &amp;gt; log.error(&quot;Problem while connecting to &quot; + this.SMSCAddress.toString(),&lt;br&gt;
&amp;gt; &amp;gt; connectFuture.getCause());&lt;br&gt;
&amp;gt; &amp;gt; return;&lt;br&gt;
&amp;gt; &amp;gt; }&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; // Wait for the server to close the connection.&lt;br&gt;
&amp;gt; &amp;gt; channel.getCloseFuture().awaitUninterruptibly();&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; // Shut down executor threads to exit.&lt;br&gt;
&amp;gt; &amp;gt; factory.releaseExternalResources();&lt;br&gt;
&amp;gt; &amp;gt; log.debug(&quot;resources released...&quot;);&lt;br&gt;
&amp;gt; &amp;gt; }&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; _______________________________________________&lt;br&gt;
&amp;gt; &amp;gt; netty-users mailing list&lt;br&gt;
&amp;gt; &amp;gt; &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2091788&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;&lt;br&gt;
&amp;gt; &amp;gt; https://lists.jboss.org/mailman/listinfo/netty-users&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2091788&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/ExecutionHandler-problem-tp2089458p2091788.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2091479</id>
	<title>Re: ExecutionHandler problem</title>
	<published>2008-12-29T22:48:48Z</published>
	<updated>2008-12-29T22:48:48Z</updated>
	<author>
		<name>Trustin Lee-3</name>
	</author>
	<content type="html">Hi Marian,
&lt;br&gt;&lt;br&gt;You need to shut down the OrderedMemoryAwareThreadPoolExecutor that
&lt;br&gt;you've created by yourself. &amp;nbsp;ChannelFactory.releaseExternalResources()
&lt;br&gt;will not shut down the Executor that is used by ExecutionHandler.
&lt;br&gt;Please call OrderedMemoryAwareThreadPoolExecutor.shutdown() after
&lt;br&gt;calling ChannelFactory.releaseExternalResources(), then everything
&lt;br&gt;should be cleaned up.
&lt;br&gt;&lt;br&gt;HTH,
&lt;br&gt;Trustin
&lt;br&gt;&lt;br&gt;On Tue, Dec 30, 2008 at 2:09 AM, Marian Stranecky
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2091479&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;marian.stranecky@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi all,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I would like to ask you for information of how to connect and shutdown the
&lt;br&gt;&amp;gt; client properly, because I have experienced a problem with netty while
&lt;br&gt;&amp;gt; trying to use an ExecutionHandler:
&lt;br&gt;&amp;gt; The threads created in OrderedMemoryAwareThreadPoolExecutor and used in
&lt;br&gt;&amp;gt; handling are running even after the channel is closed (e.g. closed by a
&lt;br&gt;&amp;gt; server after the channel is marked idle)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thanks in advance,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Marian
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; public ChannelPipeline getPipeline() throws Exception {
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ChannelPipeline pipeline = pipeline();
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; // Add the number codec first,
&lt;br&gt;&amp;gt; pipeline.addLast(&amp;quot;decoder&amp;quot;, new MyMessageDecoder());
&lt;br&gt;&amp;gt; pipeline.addLast(&amp;quot;encoder&amp;quot;, new MyMessageEncoder());
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; // utilize the processing
&lt;br&gt;&amp;gt; // pipeline.addLast(&amp;quot;executor&amp;quot;, new ExecutionHandler(new
&lt;br&gt;&amp;gt; OrderedMemoryAwareThreadPoolExecutor(16, 1048576, 1048576)));
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; // and then business logic.
&lt;br&gt;&amp;gt; pipeline.addLast(&amp;quot;handler&amp;quot;, new OISDClientHandler(this.client));
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; return pipeline;
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The client is as follows:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; public void connect(){
&lt;br&gt;&amp;gt; ExecutorService bossExecutor = Executors.newCachedThreadPool(new
&lt;br&gt;&amp;gt; CustomThreadFactory(&amp;quot;bossExecutorPool&amp;quot;));
&lt;br&gt;&amp;gt; ExecutorService workerExecutor = Executors.newCachedThreadPool(new
&lt;br&gt;&amp;gt; CustomThreadFactory(&amp;quot;workerExecutorPool&amp;quot;));
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ChannelFactory factory = new NioClientSocketChannelFactory(bossExecutor,
&lt;br&gt;&amp;gt; workerExecutor);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ClientBootstrap bootstrap = new ClientBootstrap(factory);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; bootstrap.setPipelineFactory(new OISDClientPipelineFactory(this));
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; HashMap&amp;lt;String, Object&amp;gt; opts = new HashMap&amp;lt;String, Object&amp;gt;();
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; opts.put(&amp;quot;tcpNoDelay&amp;quot;, false);
&lt;br&gt;&amp;gt; opts.put(&amp;quot;keepAlive&amp;quot;, true);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; bootstrap.setOptions(opts);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ChannelFuture connectFuture = bootstrap.connect(this.SMSCAddress);
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; // Wait until the connection attempt succeeds or fails.
&lt;br&gt;&amp;gt; this.channel = connectFuture.awaitUninterruptibly().getChannel();
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; if (!connectFuture.isSuccess()) {
&lt;br&gt;&amp;gt; log.error(&amp;quot;Problem while connecting to &amp;quot; + this.SMSCAddress.toString(),
&lt;br&gt;&amp;gt; connectFuture.getCause());
&lt;br&gt;&amp;gt; return;
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; // Wait for the server to close the connection.
&lt;br&gt;&amp;gt; channel.getCloseFuture().awaitUninterruptibly();
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; // Shut down executor threads to exit.
&lt;br&gt;&amp;gt; factory.releaseExternalResources();
&lt;br&gt;&amp;gt; log.debug(&amp;quot;resources released...&amp;quot;);
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; netty-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2091479&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
&lt;br&gt;--
&lt;br&gt;what we call human nature in actuality is human habit
&lt;br&gt;--
&lt;br&gt;&lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2091479&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/ExecutionHandler-problem-tp2089458p2091479.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2089458</id>
	<title>ExecutionHandler problem</title>
	<published>2008-12-29T09:09:45Z</published>
	<updated>2008-12-29T09:09:45Z</updated>
	<author>
		<name>marmax</name>
	</author>
	<content type="html">&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;Hi all,&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;I would like to ask you for information of how to connect and shutdown the client properly, because I have experienced a problem with netty while trying to use an ExecutionHandler: &lt;br&gt;
The threads created in OrderedMemoryAwareThreadPoolExecutor and used in handling are running even after the channel is closed (e.g. closed by a server after the channel is marked idle)&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;Thanks in advance,&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;Marian&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;public ChannelPipeline getPipeline() throws Exception {&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;        ChannelPipeline pipeline = pipeline();&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;        // Add the number codec first,&lt;br&gt;
        pipeline.addLast(&quot;decoder&quot;, new MyMessageDecoder());&lt;br&gt;
        pipeline.addLast(&quot;encoder&quot;, new MyMessageEncoder());&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;        // utilize the processing&lt;br&gt;
        // pipeline.addLast(&quot;executor&quot;, new ExecutionHandler(new OrderedMemoryAwareThreadPoolExecutor(16, 1048576, 1048576)));&lt;br&gt;
        &lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;        // and then business logic.&lt;br&gt;
        pipeline.addLast(&quot;handler&quot;, new OISDClientHandler(this.client));&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;        return pipeline;&lt;br&gt;
}&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;The client is as follows:&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;public void connect(){&lt;br&gt;
    ExecutorService bossExecutor = Executors.newCachedThreadPool(new CustomThreadFactory(&quot;bossExecutorPool&quot;));&lt;br&gt;
    ExecutorService workerExecutor = Executors.newCachedThreadPool(new CustomThreadFactory(&quot;workerExecutorPool&quot;));&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;    ChannelFactory factory = new NioClientSocketChannelFactory(bossExecutor, workerExecutor);&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;    ClientBootstrap bootstrap = new ClientBootstrap(factory);&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;    bootstrap.setPipelineFactory(new OISDClientPipelineFactory(this));&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;    HashMap&amp;lt;String, Object&amp;gt; opts = new HashMap&amp;lt;String, Object&amp;gt;();&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;    opts.put(&quot;tcpNoDelay&quot;, false);&lt;br&gt;
    opts.put(&quot;keepAlive&quot;, true);&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;    bootstrap.setOptions(opts);&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;    ChannelFuture connectFuture = bootstrap.connect(this.SMSCAddress);&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;    // Wait until the connection attempt succeeds or fails.&lt;br&gt;
    this.channel = connectFuture.awaitUninterruptibly().getChannel();&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;    if (!connectFuture.isSuccess()) {&lt;br&gt;
    log.error(&quot;Problem while connecting to &quot; + this.SMSCAddress.toString(), connectFuture.getCause());&lt;br&gt;
    return;&lt;br&gt;
    }&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;    // Wait for the server to close the connection.&lt;br&gt;
    channel.getCloseFuture().awaitUninterruptibly();&lt;br&gt;
	    &lt;br&gt;
    // Shut down executor threads to exit.&lt;br&gt;
    factory.releaseExternalResources();&lt;br&gt;
    log.debug(&quot;resources released...&quot;);&lt;br&gt;
}&lt;br&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2089458&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/ExecutionHandler-problem-tp2089458p2089458.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2054165</id>
	<title>Re: Any way to re-use the Channel..</title>
	<published>2008-12-28T18:03:05Z</published>
	<updated>2008-12-28T18:03:05Z</updated>
	<author>
		<name>Trustin Lee</name>
	</author>
	<content type="html">Hi Wesly,
&lt;br&gt;&lt;br&gt;Unfortunately, there's no way to reuse a closed socket channel at this
&lt;br&gt;moment. &amp;nbsp;You need to create a new socket channel once an existing
&lt;br&gt;socket channel is closed.
&lt;br&gt;&lt;br&gt;There's a to-do item related with this though:
&lt;br&gt;&lt;br&gt;&amp;nbsp; * &lt;a href=&quot;https://jira.jboss.org/jira/browse/NETTY-70&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://jira.jboss.org/jira/browse/NETTY-70&lt;/a&gt;&lt;br&gt;&lt;br&gt;An idea to improve the feature request I've written would be appreciated.
&lt;br&gt;&lt;br&gt;Thanks,
&lt;br&gt;Trustin
&lt;br&gt;&lt;br&gt;On Thu, Dec 18, 2008 at 3:09 PM, Wesly smith &amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2054165&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;weslysmith0@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; It could be dummy question ...
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I tried to cache and re-use the channels in http case.
&lt;br&gt;&amp;gt; Is there any way to achieve that?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Currently, the way I am doing roughly is:
&lt;br&gt;&amp;gt; ===================
&lt;br&gt;&amp;gt; // first time, I getChannel from future.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Channel c = future.getChannel();
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; c.write(httpMsg);
&lt;br&gt;&amp;gt; // cache the channels
&lt;br&gt;&amp;gt; cachedChannels.appendChannel();
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; // then in the messageReceived()
&lt;br&gt;&amp;gt; // It seems I have to disconnect(), otherwise, the transaction wont finish.
&lt;br&gt;&amp;gt; event.getChannel().disconnect();
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; // later I want to re-use the channel and get this channel from cache.
&lt;br&gt;&amp;gt; Channel ch = cachedChannels.getFreeChannel();
&lt;br&gt;&amp;gt; if (ch.isConnected() == false)
&lt;br&gt;&amp;gt; {
&lt;br&gt;&amp;gt; &amp;nbsp; future = ch.connect(address);
&lt;br&gt;&amp;gt; }
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; But I got ClosedChannelException:
&lt;br&gt;&amp;gt; NioClientSocketChannel(id: 48a7cec7-011e-1000-b33c-018557bf3f5e) - (cause:
&lt;br&gt;&amp;gt; ClosedChannelException) java.nio.channels.ClosedChannelException
&lt;br&gt;&amp;gt; &amp;nbsp; at
&lt;br&gt;&amp;gt; sun.nio.ch.SocketChannelImpl.ensureOpenAndUnconnected(SocketChannelImpl.java:472)
&lt;br&gt;&amp;gt; &amp;nbsp; at sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:486)
&lt;br&gt;&amp;gt; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.connect(NioClientSocketPipelineSink.java:143)
&lt;br&gt;&amp;gt; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.jboss.netty.channel.socket.nio.NioClientSocketPipelineSink.eventSunk(NioClientSocketPipelineSink.java:108)
&lt;br&gt;&amp;gt; &amp;nbsp; at org.jboss.netty.channel.Channels.connect(Channels.java:554)
&lt;br&gt;&amp;gt; &amp;nbsp; at
&lt;br&gt;&amp;gt; org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:166)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ====
&lt;br&gt;&amp;gt; Any idea or suggestion about re-use the Channel? I hope it will give me some
&lt;br&gt;&amp;gt; performance advantage.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; View this message in context: &lt;a href=&quot;http://n2.nabble.com/Any-way-to-re-use-the-Channel..-tp1671789p1671789.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Any-way-to-re-use-the-Channel..-tp1671789p1671789.html&lt;/a&gt;&lt;br&gt;&amp;gt; Sent from the Netty User Group mailing list archive at Nabble.com.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; netty-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2054165&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
&lt;br&gt;--
&lt;br&gt;what we call human nature in actuality is human habit
&lt;br&gt;--
&lt;br&gt;&lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2054165&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;signature&quot;&gt;Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
&lt;br&gt;--
&lt;br&gt;what we call human nature is actually human habit
&lt;br&gt;--
&lt;br&gt;&lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Re%3A-Any-way-to-re-use-the-Channel..-tp2054165p2054165.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2073657</id>
	<title>Re: Object Encoder and Decoder Query</title>
	<published>2008-12-29T01:17:41Z</published>
	<updated>2008-12-29T01:17:41Z</updated>
	<author>
		<name>Trustin Lee-3</name>
	</author>
	<content type="html">Thanks Frederic for answering the question in detail. :)
&lt;br&gt;&lt;br&gt;On Sun, Dec 28, 2008 at 3:45 AM, Frederic Bregier &amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2073657&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;fredbregier@...&lt;/a&gt;&amp;gt; wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; As far as I understand, ObjectDecoder includes the FrameDecoder itself
&lt;br&gt;&amp;gt; so you don't have to worry about it, even for huge object.
&lt;br&gt;&lt;br&gt;Right. &amp;nbsp;ObjectDecoder extends FrameDecoder. &amp;nbsp;See the class diagram in
&lt;br&gt;the Javadoc - &lt;a href=&quot;http://tinyurl.com/8t69wc&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://tinyurl.com/8t69wc&lt;/a&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
&lt;br&gt;--
&lt;br&gt;what we call human nature in actuality is human habit
&lt;br&gt;--
&lt;br&gt;&lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2073657&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Object-Encoder-and-Decoder-Query-tp2012986p2073657.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2016458</id>
	<title>Re: Object Encoder and Decoder Query</title>
	<published>2008-12-27T10:45:27Z</published>
	<updated>2008-12-27T10:45:27Z</updated>
	<author>
		<name>Frederic Bregier</name>
	</author>
	<content type="html">As far as I understand, ObjectDecoder includes the FrameDecoder itself
&lt;br&gt;so you don't have to worry about it, even for huge object.
&lt;br&gt;&lt;br&gt;The only thing I've got in my mind : what is huge object for you ?
&lt;br&gt;What I mean is : take care of &amp;quot;Out Of Memory Exception&amp;quot;...
&lt;br&gt;&lt;br&gt;For instance, let say a server accept a thousand of clients.
&lt;br&gt;Each client will send a 1 GB object (1 GB is not too big for one JVM).
&lt;br&gt;But then for Server, it will be 1000 GB of memory at once ;-(
&lt;br&gt;&lt;br&gt;If it is a file transfer, perhaps splitting the file in several parts 
&lt;br&gt;would be a good idea.
&lt;br&gt;If it is not a file transfer, so a real object, then it depends on the 
&lt;br&gt;kind of objects.
&lt;br&gt;However, whatever how you split, I think going to the disk could be the 
&lt;br&gt;only solution.
&lt;br&gt;FrameDecoder could be used to simplify the way you wrote to a disk...
&lt;br&gt;&lt;br&gt;If you don't split yourself the sending of the &amp;quot;huge&amp;quot; object,
&lt;br&gt;FrameDecoder will not help you either since it will not prevent you of OOM.
&lt;br&gt;Like ObjectDecoder, FrameDecoder will keep in memory every thing until 
&lt;br&gt;it gets
&lt;br&gt;all the data it needs to pass to your handler, so the 1000 GB in my 
&lt;br&gt;previous example...
&lt;br&gt;&lt;br&gt;In fact, about OOM, it is not completely true, in Netty you have the 
&lt;br&gt;possibility
&lt;br&gt;to handle the memory usage so that it prevents a lot of OOM. However my 
&lt;br&gt;feeling
&lt;br&gt;is that in the previous example (1GB by 1000 clients) it will be of no 
&lt;br&gt;use except
&lt;br&gt;race condition.
&lt;br&gt;&lt;br&gt;It is of course out of the scope of Netty, since it is a &amp;quot;business&amp;quot; 
&lt;br&gt;approach of your problem
&lt;br&gt;that will answer your question...
&lt;br&gt;&lt;br&gt;HTH,
&lt;br&gt;Frederic
&lt;br&gt;&lt;br&gt;manish_iitg (via Nabble) a écrit :
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Yes.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I was only asking weather FrameDecoder is in build in the ObjectDecoder.
&lt;br&gt;&amp;gt; Like, if i send a huge object over the network using ObjectEncoder and 
&lt;br&gt;&amp;gt; ObjectDecoder do i have to worry about using FrameDecder or not.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; The decoder should. If you look at the code, the encoder first puts 
&lt;br&gt;&amp;gt; the length of the
&lt;br&gt;&amp;gt; object so that the decoder can take care of it when it receives the 
&lt;br&gt;&amp;gt; packets
&lt;br&gt;&amp;gt; so that it makes the assembly correctly (like FrameDecoder).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; But for the encoder, what do you mean by packet fragmentation?
&lt;br&gt;&amp;gt; If you mean the tcp/ip fragmentation, it is not at the level of netty 
&lt;br&gt;&amp;gt; (tcp/ip
&lt;br&gt;&amp;gt; is under the wood) as a sender. But it is at the decoder part (as I 
&lt;br&gt;&amp;gt; wrote,
&lt;br&gt;&amp;gt; the decoder take care of the multiple packets from tcp/ip stack).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; If you mean fragmentation of an object, it is at your level
&lt;br&gt;&amp;gt; (splitting a big object into several smaller objects), so before Netty,
&lt;br&gt;&amp;gt; but then you have to take care too after the decoder since you will
&lt;br&gt;&amp;gt; receive several objects and not only one.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Does this answer your question?
&lt;br&gt;&amp;gt; Frederic
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; manish_iitg wrote:
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; Does object encoder and decoder also take of packet fragmentation
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; and assembly issue.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; ------------------------------------------------------------------------
&lt;br&gt;&amp;gt; This email is a reply to your post @ 
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://n2.nabble.com/Object-Encoder-and-Decoder-Query-tp2012986p2016309.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Object-Encoder-and-Decoder-Query-tp2012986p2016309.html&lt;/a&gt;&lt;br&gt;&amp;gt; You can reply by email or by visting the link above.
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;div class=&quot;signature&quot;&gt;Hardware/Software Architect&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Object-Encoder-and-Decoder-Query-tp2012986p2016458.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2016309</id>
	<title>Re: Object Encoder and Decoder Query</title>
	<published>2008-12-27T09:47:35Z</published>
	<updated>2008-12-27T09:47:35Z</updated>
	<author>
		<name>manish_iitg</name>
	</author>
	<content type="html">Yes.
&lt;br&gt;&lt;br&gt;&lt;br&gt;I was only asking weather FrameDecoder is in build in the ObjectDecoder.
&lt;br&gt;Like, if i send a huge object over the network using ObjectEncoder and ObjectDecoder do i have to worry about using FrameDecder or not.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;quote author=&quot;Frederic Bregier&quot;&gt;&lt;br&gt;Hi,
&lt;br&gt;&lt;br&gt;The decoder should. If you look at the code, the encoder first puts the length of the
&lt;br&gt;object so that the decoder can take care of it when it receives the packets
&lt;br&gt;so that it makes the assembly correctly (like FrameDecoder).
&lt;br&gt;&lt;br&gt;But for the encoder, what do you mean by packet fragmentation?
&lt;br&gt;If you mean the tcp/ip fragmentation, it is not at the level of netty (tcp/ip
&lt;br&gt;is under the wood) as a sender. But it is at the decoder part (as I wrote,
&lt;br&gt;the decoder take care of the multiple packets from tcp/ip stack).
&lt;br&gt;&lt;br&gt;If you mean fragmentation of an object, it is at your level
&lt;br&gt;(splitting a big object into several smaller objects), so before Netty,
&lt;br&gt;but then you have to take care too after the decoder since you will
&lt;br&gt;receive several objects and not only one.
&lt;br&gt;&lt;br&gt;Does this answer your question?
&lt;br&gt;Frederic
&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;manish_iitg wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message&quot;&gt;Does object encoder and decoder also take of packet fragmentation and assembly issue.
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;/quote&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Object-Encoder-and-Decoder-Query-tp2012986p2016309.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2016222</id>
	<title>Re: Object Encoder and Decoder Query</title>
	<published>2008-12-27T09:15:28Z</published>
	<updated>2008-12-27T09:15:28Z</updated>
	<author>
		<name>Frederic Bregier</name>
	</author>
	<content type="html">Hi,
&lt;br&gt;&lt;br&gt;The decoder should. If you look at the code, the encoder first puts the length of the
&lt;br&gt;object so that the decoder can take care of it when it receives the packets
&lt;br&gt;so that it makes the assembly correctly (like FrameDecoder).
&lt;br&gt;&lt;br&gt;But for the encoder, what do you mean by packet fragmentation?
&lt;br&gt;If you mean the tcp/ip fragmentation, it is not at the level of netty (tcp/ip
&lt;br&gt;is under the wood) as a sender. But it is at the decoder part (as I wrote,
&lt;br&gt;the decoder take care of the multiple packets from tcp/ip stack).
&lt;br&gt;&lt;br&gt;If you mean fragmentation of an object, it is at your level
&lt;br&gt;(splitting a big object into several smaller objects), so before Netty,
&lt;br&gt;but then you have to take care too after the decoder since you will
&lt;br&gt;receive several objects and not only one.
&lt;br&gt;&lt;br&gt;Does this answer your question?
&lt;br&gt;Frederic
&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;manish_iitg wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message&quot;&gt;Does object encoder and decoder also take of packet fragmentation and assembly issue.
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;div class=&quot;signature&quot;&gt;Hardware/Software Architect&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Object-Encoder-and-Decoder-Query-tp2012986p2016222.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2012986</id>
	<title>Object Encoder and Decoder Query</title>
	<published>2008-12-27T03:12:55Z</published>
	<updated>2008-12-27T03:12:55Z</updated>
	<author>
		<name>manish_iitg</name>
	</author>
	<content type="html">Does object encoder and decoder also take of packet fragmentation and assembly issue.</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Object-Encoder-and-Decoder-Query-tp2012986p2012986.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-1967317</id>
	<title>Netty Application hosted on internet</title>
	<published>2008-12-26T18:31:41Z</published>
	<updated>2008-12-26T18:31:41Z</updated>
	<author>
		<name>manish_iitg</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I have developed a file upload application using netty. but, currently i have only tested it on localhost. Can you tell me what all i should take care of before i test the application on a hosted server on internet. What all unexpected errors can occur when the server is hosted on internet </content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Netty-Application-hosted-on-internet-tp1967317p1967317.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-1972251</id>
	<title>Re: ChannelBuffer and   messageReceived</title>
	<published>2008-12-26T19:31:27Z</published>
	<updated>2008-12-26T19:31:27Z</updated>
	<author>
		<name>manish_iitg</name>
	</author>
	<content type="html">&lt;br&gt;Take a look at this.
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.jboss.org/file-access/default/members/netty/freezone/api/3.0/org/jboss/netty/handler/codec/frame/FrameDecoder.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.jboss.org/file-access/default/members/netty/freezone/api/3.0/org/jboss/netty/handler/codec/frame/FrameDecoder.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;This will solve all your problem.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;nixter wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;Hello,
&lt;br&gt;&lt;br&gt;I have a writed a client/server program.
&lt;br&gt;&lt;br&gt;The client send data assembled in ChannelBuffer, the data look like this :
&lt;br&gt;&lt;br&gt;Sender, receiver, tag, DATA
&lt;br&gt;&lt;br&gt;Where sender, receiver, tag are integer and datas are a set of bytes.
&lt;br&gt;&lt;br&gt;the client send data like this :
&lt;br&gt;&lt;br&gt;channel.write(ChannelBuffers.wrappedBuffer(buffer)); where buffer is a BufferByte.
&lt;br&gt;&lt;br&gt;In server side, &amp;nbsp;to gather datas I do like this :
&lt;br&gt;&lt;br&gt;public synchronized void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	 
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	ByteBuffer buff = null;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ChannelBuffer chanbuf = (ChannelBuffer) e.getMessage(); 
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; buff=chanbuf.toByteBuffer();
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	 
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	int src=buff.getInt();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int dest=buff.getInt();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int tag=buff.getInt();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;The problème is for small buffer i got the correct data, but for some buffer i receive wrong data!! I know because communication are non-bloquant. 
&lt;br&gt;&lt;br&gt;My question is : &amp;nbsp;when netty call messageReceived () is the &amp;nbsp;ChannelBuffer contains the whole data? 	
&lt;br&gt;is there a mecansime like ByteBuffer.hasremaining to read the whole data sent?
&lt;br&gt;&lt;br&gt;Please help if you have an idea or an example.
&lt;br&gt;&lt;br&gt;P.S sorry for my English
&lt;br&gt;&lt;br&gt;---- Here some log :
&lt;br&gt;&lt;br&gt;the client send one message (header+data), and i noticed that messageReceived () is invoked 5 time!!
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=1536, cap=1536))
&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=2048, cap=2048))
&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=3072, cap=3072))
&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=4096, cap=4096))
&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=4657, cap=6144)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/ChannelBuffer-and---messageReceived-tp1943393p1972251.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-1967638</id>
	<title>Re: ChannelBuffer and   messageReceived</title>
	<published>2008-12-26T18:35:39Z</published>
	<updated>2008-12-26T18:35:39Z</updated>
	<author>
		<name>manish_iitg</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I have faced the same problem. I think there are two solutions for this.
&lt;br&gt;&lt;br&gt;1. If the message that you are sending is of fixed size then, you can use framedecoder as given in the UserGuide.
&lt;br&gt;&lt;br&gt;2. IF the message that you are sending is of variable size then you need to send the length of message first and the entire message. 
&lt;br&gt;&lt;br&gt;&lt;br&gt;ChannelBuffer buffer = (ChannelBuffer) e.getMessage();
&lt;br&gt;dataBuffer.writeBytes(buffer); // data buffer, class level variable
&lt;br&gt;if (dataBuffer.readableBytes() &amp;lt; length) //the length you sent
&lt;br&gt;return;
&lt;br&gt;//go ahead
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;nixter wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;Hello,
&lt;br&gt;&lt;br&gt;I have a writed a client/server program.
&lt;br&gt;&lt;br&gt;The client send data assembled in ChannelBuffer, the data look like this :
&lt;br&gt;&lt;br&gt;Sender, receiver, tag, DATA
&lt;br&gt;&lt;br&gt;Where sender, receiver, tag are integer and datas are a set of bytes.
&lt;br&gt;&lt;br&gt;the client send data like this :
&lt;br&gt;&lt;br&gt;channel.write(ChannelBuffers.wrappedBuffer(buffer)); where buffer is a BufferByte.
&lt;br&gt;&lt;br&gt;In server side, &amp;nbsp;to gather datas I do like this :
&lt;br&gt;&lt;br&gt;public synchronized void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	 
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	ByteBuffer buff = null;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ChannelBuffer chanbuf = (ChannelBuffer) e.getMessage(); 
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; buff=chanbuf.toByteBuffer();
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	 
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	int src=buff.getInt();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int dest=buff.getInt();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int tag=buff.getInt();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;The problème is for small buffer i got the correct data, but for some buffer i receive wrong data!! I know because communication are non-bloquant. 
&lt;br&gt;&lt;br&gt;My question is : &amp;nbsp;when netty call messageReceived () is the &amp;nbsp;ChannelBuffer contains the whole data? 	
&lt;br&gt;is there a mecansime like ByteBuffer.hasremaining to read the whole data sent?
&lt;br&gt;&lt;br&gt;Please help if you have an idea or an example.
&lt;br&gt;&lt;br&gt;P.S sorry for my English
&lt;br&gt;&lt;br&gt;---- Here some log :
&lt;br&gt;&lt;br&gt;the client send one message (header+data), and i noticed that messageReceived () is invoked 5 time!!
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=1536, cap=1536))
&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=2048, cap=2048))
&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=3072, cap=3072))
&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=4096, cap=4096))
&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=4657, cap=6144)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/ChannelBuffer-and---messageReceived-tp1943393p1967638.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-1943393</id>
	<title>ChannelBuffer and   messageReceived</title>
	<published>2008-12-26T14:09:03Z</published>
	<updated>2008-12-26T14:09:03Z</updated>
	<author>
		<name>nixter</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I have a writed a client/server program.
&lt;br&gt;&lt;br&gt;The client send data assembled in ChannelBuffer, the data look like this :
&lt;br&gt;&lt;br&gt;Sender, receiver, tag, DATA
&lt;br&gt;&lt;br&gt;Where sender, receiver, tag are integer and datas are a set of bytes.
&lt;br&gt;&lt;br&gt;the client send data like this :
&lt;br&gt;&lt;br&gt;channel.write(ChannelBuffers.wrappedBuffer(buffer)); where buffer is a BufferByte.
&lt;br&gt;&lt;br&gt;In server side, &amp;nbsp;to gather datas I do like this :
&lt;br&gt;&lt;br&gt;public synchronized void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	 
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	ByteBuffer buff = null;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;	 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ChannelBuffer chanbuf = (ChannelBuffer) e.getMessage(); 
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; buff=chanbuf.toByteBuffer();
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	 
&lt;br&gt;&amp;nbsp; &amp;nbsp; 	int src=buff.getInt();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int dest=buff.getInt();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; int tag=buff.getInt();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ...
&lt;br&gt;}
&lt;br&gt;&lt;br&gt;The problème is for small buffer i got the correct data, but for some buffer i receive wrong data!! I know because communication are non-bloquant. 
&lt;br&gt;&lt;br&gt;My question is : &amp;nbsp;when netty call messageReceived () is the &amp;nbsp;ChannelBuffer contains the whole data? 	
&lt;br&gt;is there a mecansime like ByteBuffer.hasremaining to read the whole data sent?
&lt;br&gt;&lt;br&gt;Please help if you have an idea or an example.
&lt;br&gt;&lt;br&gt;P.S sorry for my English
&lt;br&gt;&lt;br&gt;---- Here some log :
&lt;br&gt;&lt;br&gt;the client send one message (header+data), and i noticed that messageReceived () is invoked 5 time!!
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=1536, cap=1536))
&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=2048, cap=2048))
&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=3072, cap=3072))
&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=4096, cap=4096))
&lt;br&gt;(message: BigEndianHeapChannelBuffer(ridx=0, widx=4657, cap=6144)
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/ChannelBuffer-and---messageReceived-tp1943393p1943393.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2053876</id>
	<title>Re: Netty Application hosted on internet</title>
	<published>2008-12-28T17:59:32Z</published>
	<updated>2008-12-28T17:59:32Z</updated>
	<author>
		<name>Trustin Lee</name>
	</author>
	<content type="html">Hi Manish,
&lt;br&gt;&lt;br&gt;I think there's more chance of:
&lt;br&gt;&lt;br&gt;&amp;nbsp; * packet fragmentation and assembly
&lt;br&gt;&amp;nbsp; * unexpected disconnection (more frequent connection reset by peer)
&lt;br&gt;&amp;nbsp; * unnoticed disconnection (client or server doesn't notice the
&lt;br&gt;disconnection until it writes something)
&lt;br&gt;&lt;br&gt;The first issue will appear in localhost under load, so you should
&lt;br&gt;have covered it already. &amp;nbsp;The second one is OK to ignore IMHO, because
&lt;br&gt;you need to write your application robust enough to deal with an
&lt;br&gt;unexpected disconnection. &amp;nbsp;The third one might not appear in the
&lt;br&gt;localhost testing - you usually send a periodical ping message to a
&lt;br&gt;remote peer to detect the dead connection.
&lt;br&gt;&lt;br&gt;That's all I can think of at this moment.
&lt;br&gt;&lt;br&gt;On Sat, Dec 27, 2008 at 3:17 AM, manish_iitg
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2053876&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;excellencetechnologies08@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I have developed a file upload application using netty. but, currently i
&lt;br&gt;&amp;gt; have only tested it on localhost. Can you tell me what all i should take
&lt;br&gt;&amp;gt; care of before i test the application on a hosted server on internet. What
&lt;br&gt;&amp;gt; all unexpected errors can occur when the server is hosted on internet
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; View this message in context: &lt;a href=&quot;http://n2.nabble.com/Netty-Application-hosted-on-internet-tp1922335p1922335.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Netty-Application-hosted-on-internet-tp1922335p1922335.html&lt;/a&gt;&lt;br&gt;&amp;gt; Sent from the Netty User Group mailing list archive at Nabble.com.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; netty-users mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2053876&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
&lt;br&gt;--
&lt;br&gt;what we call human nature in actuality is human habit
&lt;br&gt;--
&lt;br&gt;&lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2053876&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;&lt;div class=&quot;signature&quot;&gt;Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
&lt;br&gt;--
&lt;br&gt;what we call human nature is actually human habit
&lt;br&gt;--
&lt;br&gt;&lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Netty-Application-hosted-on-internet-tp1922335p2053876.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-1922335</id>
	<title>Netty Application hosted on internet</title>
	<published>2008-12-26T10:17:10Z</published>
	<updated>2008-12-26T10:17:10Z</updated>
	<author>
		<name>manish_iitg</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I have developed a file upload application using netty. but, currently i have only tested it on localhost. Can you tell me what all i should take care of before i test the application on a hosted server on internet. What all unexpected errors can occur when the server is hosted on internet</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Netty-Application-hosted-on-internet-tp1922335p1922335.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2122838</id>
	<title>Re: Non-Netty client - Any help please, nearly there!</title>
	<published>2009-01-07T06:54:41Z</published>
	<updated>2009-01-07T06:54:41Z</updated>
	<author>
		<name>skhalid</name>
	</author>
	<content type="html">Hi Trustin,&lt;br&gt;&lt;br&gt;Thanks for the quick update - I&amp;#39;ll try this and get back to you. &lt;br&gt;&lt;br&gt;Cheers&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Jan 7, 2009 at 12:38 AM, Trustin Lee &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2122838&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;trustin@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;I did a quick research on Android SDK and it seems like javax.management package is the only missing one to run Netty.&amp;nbsp; Here&amp;#39;s a JIRA issue I have filed:&lt;br&gt;
&lt;br&gt;&amp;nbsp; * &lt;a href=&quot;https://jira.jboss.org/jira/browse/NETTY-103&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://jira.jboss.org/jira/browse/NETTY-103&lt;/a&gt;&lt;br&gt;
&lt;br&gt;HTH,&lt;br clear=&quot;all&quot;&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;— Trustin Lee, &lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;Wj3C7c&quot;&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Jan 7, 2009 at 4:18 AM, skhalid &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2122838&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;shahbaz.khalid@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;

&lt;br&gt;
&lt;br&gt;
Hello,&lt;br&gt;
&lt;br&gt;
Thanks for the fix Trustin - appreciate your help. Since this was a hacked&lt;br&gt;
up test client, I wasn&amp;#39;t aiming it to be perfect =^D&lt;br&gt;
&lt;br&gt;
Lets say we build our own TimeBasedUuidGenerator class (thinking of&lt;br&gt;
recompiling netty for android - Apache MINA client works perfectly ok on&lt;br&gt;
android after removing the logger classes) - any thoughts on how it can be&lt;br&gt;
changed to not use the packages android is conflicting with&lt;br&gt;
(java.lang.management.*)?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
--&lt;br&gt;
View this message in context: &lt;a href=&quot;http://n2.nabble.com/Non-Netty-client-tp1771503p2118957.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Non-Netty-client-tp1771503p2118957.html&lt;/a&gt;&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Sent from the Netty User Group mailing list archive at Nabble.com.&lt;br&gt;
&lt;br&gt;
_______________________________________________&lt;br&gt;
netty-users mailing list&lt;br&gt;
&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2122838&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;br&gt;_______________________________________________&lt;br&gt;
netty-users mailing list&lt;br&gt;
&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2122838&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2122838&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Non-Netty-client-tp1771503p2122838.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2120303</id>
	<title>Re: Non-Netty client - Any help please, nearly there!</title>
	<published>2009-01-06T16:59:35Z</published>
	<updated>2009-01-06T16:59:35Z</updated>
	<author>
		<name>Trustin Lee-3</name>
	</author>
	<content type="html">I&amp;#39;ve just improved TimeBasedUuidGenerator so that it doesn&amp;#39;t reference java.lang.management directly.&amp;nbsp; Could you svn up and give it a try?&lt;br&gt;&lt;br&gt;Thanks in advance,&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;— Trustin Lee, &lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;

&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Jan 7, 2009 at 9:38 AM, Trustin Lee &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2120303&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;trustin@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
I did a quick research on Android SDK and it seems like javax.management package is the only missing one to run Netty.&amp;nbsp; Here&amp;#39;s a JIRA issue I have filed:&lt;br&gt;&lt;br&gt;&amp;nbsp; * &lt;a href=&quot;https://jira.jboss.org/jira/browse/NETTY-103&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://jira.jboss.org/jira/browse/NETTY-103&lt;/a&gt;&lt;br&gt;

&lt;br&gt;HTH,&lt;br clear=&quot;all&quot;&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;— Trustin Lee, &lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;Wj3C7c&quot;&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Jan 7, 2009 at 4:18 AM, skhalid &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2120303&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;shahbaz.khalid@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;

&lt;br&gt;
&lt;br&gt;
Hello,&lt;br&gt;
&lt;br&gt;
Thanks for the fix Trustin - appreciate your help. Since this was a hacked&lt;br&gt;
up test client, I wasn&amp;#39;t aiming it to be perfect =^D&lt;br&gt;
&lt;br&gt;
Lets say we build our own TimeBasedUuidGenerator class (thinking of&lt;br&gt;
recompiling netty for android - Apache MINA client works perfectly ok on&lt;br&gt;
android after removing the logger classes) - any thoughts on how it can be&lt;br&gt;
changed to not use the packages android is conflicting with&lt;br&gt;
(java.lang.management.*)?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
--&lt;br&gt;
View this message in context: &lt;a href=&quot;http://n2.nabble.com/Non-Netty-client-tp1771503p2118957.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Non-Netty-client-tp1771503p2118957.html&lt;/a&gt;&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;Sent from the Netty User Group mailing list archive at Nabble.com.&lt;br&gt;
&lt;br&gt;
_______________________________________________&lt;br&gt;
netty-users mailing list&lt;br&gt;
&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2120303&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2120303&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Non-Netty-client-tp1771503p2120303.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2120238</id>
	<title>Re: Non-Netty client - Any help please, nearly there!</title>
	<published>2009-01-06T16:38:15Z</published>
	<updated>2009-01-06T16:38:15Z</updated>
	<author>
		<name>Trustin Lee-3</name>
	</author>
	<content type="html">I did a quick research on Android SDK and it seems like javax.management package is the only missing one to run Netty.&amp;nbsp; Here&amp;#39;s a JIRA issue I have filed:&lt;br&gt;&lt;br&gt;&amp;nbsp; * &lt;a href=&quot;https://jira.jboss.org/jira/browse/NETTY-103&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://jira.jboss.org/jira/browse/NETTY-103&lt;/a&gt;&lt;br&gt;
&lt;br&gt;HTH,&lt;br clear=&quot;all&quot;&gt;&lt;br&gt;— Trustin Lee, &lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Wed, Jan 7, 2009 at 4:18 AM, skhalid &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2120238&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;shahbaz.khalid@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
&lt;br&gt;
&lt;br&gt;
Hello,&lt;br&gt;
&lt;br&gt;
Thanks for the fix Trustin - appreciate your help. Since this was a hacked&lt;br&gt;
up test client, I wasn&amp;#39;t aiming it to be perfect =^D&lt;br&gt;
&lt;br&gt;
Lets say we build our own TimeBasedUuidGenerator class (thinking of&lt;br&gt;
recompiling netty for android - Apache MINA client works perfectly ok on&lt;br&gt;
android after removing the logger classes) - any thoughts on how it can be&lt;br&gt;
changed to not use the packages android is conflicting with&lt;br&gt;
(java.lang.management.*)?&lt;br&gt;
&lt;br&gt;
Thanks&lt;br&gt;
&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;
--&lt;br&gt;
View this message in context: &lt;a href=&quot;http://n2.nabble.com/Non-Netty-client-tp1771503p2118957.html&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://n2.nabble.com/Non-Netty-client-tp1771503p2118957.html&lt;/a&gt;&lt;br&gt;
&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;Wj3C7c&quot;&gt;Sent from the Netty User Group mailing list archive at Nabble.com.&lt;br&gt;
&lt;br&gt;
_______________________________________________&lt;br&gt;
netty-users mailing list&lt;br&gt;
&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2120238&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;br /&gt;_______________________________________________
&lt;br&gt;netty-users mailing list
&lt;br&gt;&lt;a href=&quot;http://n2.nabble.com/user/SendEmail.jtp?type=node&amp;node=2120238&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;netty-users@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.jboss.org/mailman/listinfo/netty-users&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.jboss.org/mailman/listinfo/netty-users&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Non-Netty-client-tp1771503p2120238.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2118957</id>
	<title>Re: Non-Netty client - Any help please, nearly there!</title>
	<published>2009-01-06T11:18:10Z</published>
	<updated>2009-01-06T11:18:10Z</updated>
	<author>
		<name>skhalid</name>
	</author>
	<content type="html">&lt;br&gt;Hello,
&lt;br&gt;&lt;br&gt;Thanks for the fix Trustin - appreciate your help. Since this was a hacked up test client, I wasn't aiming it to be perfect &lt;img class='smiley' src='http://n2.nabble.com/images/smiley/smiley_grin.gif' /&gt;&lt;br&gt;&lt;br&gt;Lets say we build our own TimeBasedUuidGenerator class (thinking of recompiling netty for android - Apache MINA client works perfectly ok on android after removing the logger classes) - any thoughts on how it can be changed to not use the packages android is conflicting with (java.lang.management.*)?
&lt;br&gt;&lt;br&gt;Thanks
&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Non-Netty-client-tp1771503p2118957.html" />
</entry>

<entry>
	<id>tag:n2.nabble.com,2006:post-2115980</id>
	<title>Re: Non-Netty client - Any help please, nearly there!</title>
	<published>2009-01-05T18:12:50Z</published>
	<updated>2009-01-05T18:12:50Z</updated>
	<author>
		<name>Trustin Lee</name>
	</author>
	<content type="html">Hi, 
&lt;br&gt;&lt;br&gt;Sorry for a belated resolution, but I found a major bug in ObjectDecoderInputStream, and it's fixed now. &amp;nbsp;Please check out the latest revision from the trunk and give it a try:
&lt;br&gt;&lt;br&gt;&amp;nbsp; * &lt;a href=&quot;https://jira.jboss.org/jira/browse/NETTY-101&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://jira.jboss.org/jira/browse/NETTY-101&lt;/a&gt;&lt;br&gt;&lt;br&gt;BTW, I had to change the hard coded constant '300' to '196' to make the application work. &amp;nbsp;Perhaps hard-coding the expected number of bytes is not a good idea?
&lt;br&gt;&lt;br&gt;HTH,
&lt;br&gt;Trustin
&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;skhalid wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;Hi Trustin,
&lt;br&gt;&lt;br&gt;Apologies for the delay in getting back to you - we need to get this resolved as soon as possible for our project delivery. Thanks for resolving the mystery of the magic header not coming in due to compatibleencoder just sending it once - that's probably the issue. We are dropping serialization/object communications support in favour of JSON/String based communications because it is more compact as compared to binary/serialized bytes (also since Android has it's own jvm called dalvik, objects serialised in that environment may/may not deserialise properly in another environment). But just to continue problem resolution of the serialisation stuff:
&lt;br&gt;&lt;br&gt;We've now changed the code to :
&lt;br&gt;&lt;br&gt;&lt;br&gt;ByteArrayInputStream bais = new ByteArrayInputStream(ary);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ObjectDecoderInputStream ois = new ObjectDecoderInputStream(bais);
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; User c = null;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Object myObject = ois.readObject();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&amp;quot;Object of class is &amp;quot; + myObject.getClass().toString());
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c = (User)myObject;
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (ClassNotFoundException e) {
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; e.printStackTrace();
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;And also used the ObjectEncoder/ObjectDecoder on server - but here is what we are getting now in client :
&lt;br&gt;&lt;br&gt;Exception in thread &amp;quot;main&amp;quot; java.io.StreamCorruptedException: Unsupported version: 0
&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; at org.jboss.netty.handler.codec.serialization.CompactObjectInputStream.readStreamHeader(CompactObjectInputStream.java:57)
&lt;br&gt;&lt;br&gt;Have no idea why this is occurring...
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;The reason we can't use Netty classes (or more importantly, the Netty Client code) &amp;nbsp;is because the dalvik jvm does not fully support all JDK classes/packages - so far we've discovered the java.lang.management.* package. We can't proceed beyond the point where the netty client code in Android tries to reference the TimeBasedUuidGenerator class/creation. There *might* be other classes not working with Android, but we need a solution on how to avoid the problem in TimeBasedUuidGenerator (maybe somehow provide another version of TimeBasedUuidGenerator - so this is not essentially recompiling, but extending/adding more code at runtime). For a list of what is available in android jvm:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://code.google.com/android/reference/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/android/reference/&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://code.google.com/android/reference/packages.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/android/reference/packages.html&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://code.google.com/android/reference/classes.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://code.google.com/android/reference/classes.html&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;div class=&quot;signature&quot;&gt;Trustin Lee, Principal Software Engineer, JBoss, a division of Red Hat
&lt;br&gt;--
&lt;br&gt;what we call human nature is actually human habit
&lt;br&gt;--
&lt;br&gt;&lt;a href=&quot;http://gleamynode.net/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://gleamynode.net/&lt;/a&gt;&lt;/div&gt;</content>
	<link rel="alternate" type="text/html" href="http://n2.nabble.com/Non-Netty-client-tp1771503p2115980.html" />
</entry>

</feed>
