public class PipeDuplexLayer<RCV_UP,RCV_DOWN,SND_UP,SND_DOWN> extends Object implements PipeLayer<RCV_UP,RCV_DOWN,SND_UP,SND_DOWN>
PipeDuplexLayer`s in opposite directions can to PipeLayerPipeLayer| 构造器和说明 |
|---|
PipeDuplexLayer(PipeHandler<RCV_UP,RCV_DOWN> decoder,
PipeHandler<SND_UP,SND_DOWN> encoder) |
| 限定符和类型 | 方法和说明 |
|---|---|
PipeStatus |
doError(PipeContext context,
boolean isRcv,
Throwable e,
PipeExceptionHolder eh)
Gets called if a Throwable was thrown.
|
PipeStatus |
doLayer(PipeContext context,
boolean isRcv,
PipeRcvQueue<RCV_UP> rcvUp,
PipeSndQueue<RCV_DOWN> rcvDown,
PipeRcvQueue<SND_UP> sndUp,
PipeSndQueue<SND_DOWN> sndDown)
process data the protocol stack.
|
void |
init(PipeContext context)
Initialize the protocol stack, when the Connected.
|
void |
release(PipeContext context)
release protocol stack, connection close.
|
public PipeDuplexLayer(PipeHandler<RCV_UP,RCV_DOWN> decoder, PipeHandler<SND_UP,SND_DOWN> encoder)
public void init(PipeContext context) throws Exception
PipeLayerpublic PipeStatus doLayer(PipeContext context, boolean isRcv, PipeRcvQueue<RCV_UP> rcvUp, PipeSndQueue<RCV_DOWN> rcvDown, PipeRcvQueue<SND_UP> sndUp, PipeSndQueue<SND_DOWN> sndDown) throws IOException
PipeLayerPipeRcvQueue.rcvSubmit()/PipeSndQueue.sndSubmit() method of (RCV_UP, RCV_DOWN, SND_UP, SND_DOWN) will be called.
PipeLayer.doError(PipeContext, boolean, Throwable, PipeExceptionHolder).public PipeStatus doError(PipeContext context, boolean isRcv, Throwable e, PipeExceptionHolder eh) throws Throwable
PipeLayerPipeRcvQueue.rcvReset()/PipeSndQueue.sndReset() method of (RCV_UP, RCV_DOWN, SND_UP, SND_DOWN) will be called
... -> doLayer -> doLayer -> Exception
|
doError -> doError -> doError...
You can clear the exception flag with the PipeExceptionHolder.clear() method, and piple execution will continue normally
... -> doLayer -> doError -> doError(invoker clear) -> doLayer -> ...
Copyright © 2022–2024. All rights reserved.