Question on LocalChannel

Frederic Bregier fredbregier at free.fr
Wed Jul 8 08:57:32 EDT 2009


Hi,

I've made some other tests today and I was able to reproduce the same error
than in my project.
But the error is not stable (sometimes it runs ok, sometimes not, let say 1
on 3 times).

I use the last version you just published for testing on AIX. And I've got
the same problem (under windows) with this LocalChannel example.

I modify a bit the code in order to check the status of the connection and
to print out the exception and to really return back...
Here is what I've got:

...
Start 1
[id: 0x01bac748] OPEN
[id: 0x01bac748] CONNECT: local:1
[id: 0x01bac748, local:ephemeral] BOUND: local:ephemeral
[id: 0x01bac748, local:ephemeral] CONNECTED: local:1
[id: 0x01bac748, local:ephemeral] WRITE: First
[id: 0x01bac748, local:ephemeral] WRITTEN_AMOUNT: 1
[id: 0x01bac748, local:ephemeral] WRITE: Second
[id: 0x01bac748, local:ephemeral] WRITTEN_AMOUNT: 1
[id: 0x01bac748, local:ephemeral] WRITE: Third
[id: 0x01bac748, local:ephemeral] WRITTEN_AMOUNT: 1
[id: 0x01bac748, local:ephemeral] WRITE: quit
[id: 0x01bac748, local:ephemeral] WRITTEN_AMOUNT: 1
[id: 0x01bac748, local:ephemeral] CLOSE
[id: 0x01bac748, local:ephemeral => local:1] DISCONNECTED
[id: 0x01bac748, local:ephemeral => local:1] UNBOUND
[id: 0x01bac748, local:ephemeral => local:1] CLOSED
End 1
Start 2
[id: 0x004b222f] OPEN
[id: 0x004b222f] CONNECT: local:1
CANNOT CONNECT
java.net.ConnectException: connection refused
	at
org.jboss.netty.channel.local.LocalClientChannelSink.connect(LocalClientChannelSink.java:122)
	at
org.jboss.netty.channel.local.LocalClientChannelSink.eventSunk(LocalClientChannelSink.java:79)
	at
org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:791)
	at
org.jboss.netty.handler.codec.oneone.OneToOneEncoder.handleDownstream(OneToOneEncoder.java:66)
	at
org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:590)
	at
org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendDownstream(DefaultChannelPipeline.java:796)
	at
org.jboss.netty.example.local.LocalExampleMultiple$PrintHandler.handleDownstream(LocalExampleMultiple.java:116)
	at
org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:590)
	at
org.jboss.netty.channel.DefaultChannelPipeline.sendDownstream(DefaultChannelPipeline.java:585)
	at org.jboss.netty.channel.Channels.connect(Channels.java:762)
	at
org.jboss.netty.channel.AbstractChannel.connect(AbstractChannel.java:195)
	at
org.jboss.netty.bootstrap.ClientBootstrap$Connector.channelOpen(ClientBootstrap.java:287)
	at
org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:103)
	at
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:567)
	at
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:562)
	at org.jboss.netty.channel.Channels.fireChannelOpen(Channels.java:197)
	at
org.jboss.netty.channel.local.DefaultLocalChannel.<init>(DefaultLocalChannel.java:64)
	at
org.jboss.netty.channel.local.DefaultLocalClientChannelFactory.newChannel(DefaultLocalClientChannelFactory.java:48)
	at
org.jboss.netty.channel.local.DefaultLocalClientChannelFactory.newChannel(DefaultLocalClientChannelFactory.java:1)
	at
org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:235)
	at
org.jboss.netty.bootstrap.ClientBootstrap.connect(ClientBootstrap.java:199)
	at
org.jboss.netty.example.local.LocalExampleMultiple.main(LocalExampleMultiple.java:77)

Here are the new codes:

http://n2.nabble.com/file/n3225269/LocalExampleMultiple.java
LocalExampleMultiple.java 
http://n2.nabble.com/file/n3225269/LocalServerPipelineFactory.java
LocalServerPipelineFactory.java 

HTH,
Frederic

-----
Hardware/Software Architect
-- 
View this message in context: http://n2.nabble.com/Question-on-LocalChannel-tp3222132p3225269.html
Sent from the Netty Developer Group mailing list archive at Nabble.com.



More information about the netty-dev mailing list