File tree Expand file tree Collapse file tree 2 files changed +3
-21
lines changed Expand file tree Collapse file tree 2 files changed +3
-21
lines changed Original file line number Diff line number Diff line change @@ -32,24 +32,7 @@ partial void InternalStart()
32
32
// consider port started when we're listening for inbound connections
33
33
_status = ForwardedPortStatus . Started ;
34
34
35
- try
36
- {
37
- StartAccept ( null ) ;
38
- }
39
- catch ( ObjectDisposedException )
40
- {
41
- // AcceptAsync will throw an ObjectDisposedException when the server is closed before
42
- // the listener has started accepting connections.
43
- //
44
- // this is only possible when the listener is stopped (from another thread) right
45
- // after it was started.
46
- StopPort ( Session . ConnectionInfo . Timeout ) ;
47
- }
48
- catch ( Exception ex )
49
- {
50
- StopPort ( Session . ConnectionInfo . Timeout ) ;
51
- RaiseExceptionEvent ( ex ) ;
52
- }
35
+ StartAccept ( null ) ;
53
36
}
54
37
55
38
private void StartAccept ( SocketAsyncEventArgs e )
Original file line number Diff line number Diff line change @@ -131,11 +131,10 @@ protected override void StopPort(TimeSpan timeout)
131
131
132
132
// signal existing channels that the port is closing
133
133
base . StopPort ( timeout ) ;
134
+ // prevent new requests from getting processed
135
+ StopListener ( ) ;
134
136
// wait for open channels to close
135
137
InternalStop ( timeout ) ;
136
- // prevent new requests from getting processed before we signal existing
137
- // channels that the port is closing
138
- StopListener ( ) ;
139
138
// mark port stopped
140
139
_status = ForwardedPortStatus . Stopped ;
141
140
}
You can’t perform that action at this time.
0 commit comments