Re: [hawtdispatch] question about TcpTransport's onConnected method implement?

21 views
Skip to first unread message

Christian Posta

unread,
Apr 16, 2013, 8:52:33 AM4/16/13
to hawtdi...@googlegroups.com
Maybe in your listener, you can try doing transport.resumeRead() ?

When you do transport.start() it will set up the appropriate event handlers and then call your transportListener.onTransportConnected(). when it calls that, you can start reading from the transport. You may wish to check out Apache Apollo that has this implemented, including a pluggable protocol handler:


and


HTH...


On Mon, Apr 15, 2013 at 6:23 PM, netcomm <baiw...@yahoo.cn> wrote:
hello.
I'm new to HawtDispatch and have a question about TcpTransport implement.my usage scenario is use TcpTransportServer to recieve clients endpoint data,in server endpoint use a TcpTransport  wrapper a client,i use the follow code:

Dispatcher dispatcher = new DispatcherConfig().createDispatcher();
theTransport.setDispatchQueue(dispatcher.createQueue("clientxxx"));
theTransport.setProtocolCodec(new MarsProtocolCodec());
theTransport.setTransportListener(new MarsTransportListener());
((TcpTransport)theTransport).start(Dispatch.NOOP);

but it don't work,it can recieve any data from client.so i check the TcpTransport implement,i find in method "onConnected" is something odd,so i add one line
"readSource.resume();“ in the method end. now it is work,it can recieve data from client.

the problem is my wrong use, or is the "onConnected" bug?

thanks in advance!

--
You received this message because you are subscribed to the Google Groups "hawtdispatch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hawtdispatch...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Christian Posta
twitter: @christianposta
Reply all
Reply to author
Forward
0 new messages