Fixed a problem where LocalChannel.getParent() always returns null
This commit is contained in:
parent
a0e57b4428
commit
ce7ca53bdf
@ -55,8 +55,8 @@ public class LocalChannel extends AbstractChannel {
|
||||
private final LocalChannelConfig config;
|
||||
final Queue<MessageEvent> writeBuffer = new LinkedTransferQueue<MessageEvent>();
|
||||
|
||||
LocalChannel(ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, LocalChannel pairedChannel) {
|
||||
super(null, factory, pipeline, sink);
|
||||
LocalChannel(LocalServerChannel parent, ChannelFactory factory, ChannelPipeline pipeline, ChannelSink sink, LocalChannel pairedChannel) {
|
||||
super(parent, factory, pipeline, sink);
|
||||
this.pairedChannel = pairedChannel;
|
||||
config = new LocalChannelConfig();
|
||||
fireChannelOpen(this);
|
||||
|
@ -39,7 +39,7 @@ public class LocalClientChannelFactory implements ChannelFactory {
|
||||
}
|
||||
|
||||
public Channel newChannel(ChannelPipeline pipeline) {
|
||||
return new LocalChannel(this, pipeline, sink, null);
|
||||
return new LocalChannel(null, this, pipeline, sink, null);
|
||||
}
|
||||
|
||||
public void releaseExternalResources() {
|
||||
|
@ -129,7 +129,7 @@ final class LocalClientChannelSink extends AbstractChannelSink {
|
||||
}
|
||||
|
||||
future.setSuccess();
|
||||
LocalChannel acceptedChannel = new LocalChannel(serverChannel.getFactory(), pipeline, this, channel);
|
||||
LocalChannel acceptedChannel = new LocalChannel(serverChannel, serverChannel.getFactory(), pipeline, this, channel);
|
||||
channel.pairedChannel = acceptedChannel;
|
||||
|
||||
bind(channel, succeededFuture(channel), LocalAddress.newEphemeralInstance());
|
||||
|
Loading…
Reference in New Issue
Block a user