- this.state = State.OpenSent;
-
- this.channel.eventLoop().schedule(new Runnable() {
- @Override
- public void run() {
- if (AbstractBGPSessionNegotiator.this.state != State.Finished) {
- AbstractBGPSessionNegotiator.this.sendMessage(buildErrorNotify(BGPError.HOLD_TIMER_EXPIRED));
- negotiationFailed(new BGPDocumentedException("HoldTimer expired", BGPError.FSM_ERROR));
- AbstractBGPSessionNegotiator.this.state = State.Finished;
+ if (this.state != State.Finished) {
+ this.state = State.OpenSent;
+
+ this.channel.eventLoop().schedule(new Runnable() {
+ @Override
+ public void run() {
+ if (AbstractBGPSessionNegotiator.this.state != State.Finished) {
+ AbstractBGPSessionNegotiator.this.sendMessage(buildErrorNotify(BGPError.HOLD_TIMER_EXPIRED));
+ negotiationFailed(new BGPDocumentedException("HoldTimer expired", BGPError.FSM_ERROR));
+ AbstractBGPSessionNegotiator.this.state = State.Finished;
+ }