@@ -111,7 +111,7 @@ fn start_method_handler_thread(
111
111
// notify the connection dealing main thread to stop.
112
112
control_tx
113
113
. send ( ( ) )
114
- . unwrap_or_else ( |err| debug ! ( "Failed to try send {:?}" , err) ) ;
114
+ . unwrap_or_else ( |err| debug ! ( "Failed to send {:?}" , err) ) ;
115
115
break ;
116
116
}
117
117
result = read_message ( fd) ;
@@ -121,7 +121,7 @@ fn start_method_handler_thread(
121
121
// notify the connection dealing main thread to stop.
122
122
control_tx
123
123
. send ( ( ) )
124
- . unwrap_or_else ( |err| debug ! ( "Failed to try send {:?}" , err) ) ;
124
+ . unwrap_or_else ( |err| debug ! ( "Failed to send {:?}" , err) ) ;
125
125
break ;
126
126
}
127
127
@@ -130,7 +130,7 @@ fn start_method_handler_thread(
130
130
trace ! ( "notify client handler to create much more worker threads!" ) ;
131
131
control_tx
132
132
. send ( ( ) )
133
- . unwrap_or_else ( |err| debug ! ( "Failed to try send {:?}" , err) ) ;
133
+ . unwrap_or_else ( |err| debug ! ( "Failed to send {:?}" , err) ) ;
134
134
}
135
135
136
136
let mh;
@@ -149,7 +149,8 @@ fn start_method_handler_thread(
149
149
// have exited.
150
150
control_tx
151
151
. send ( ( ) )
152
- . unwrap_or_else ( |err| debug ! ( "Failed to try send {:?}" , err) ) ;
152
+ . unwrap_or_else ( |err| debug ! ( "Failed to send {:?}" , err) ) ;
153
+ trace ! ( "Socket error send control_tx" ) ;
153
154
break ;
154
155
}
155
156
_ => {
@@ -176,7 +177,7 @@ fn start_method_handler_thread(
176
177
// exited.
177
178
control_tx
178
179
. send ( ( ) )
179
- . unwrap_or_else ( |err| debug ! ( "Failed to try send {:?}" , err) ) ;
180
+ . unwrap_or_else ( |err| debug ! ( "Failed to send {:?}" , err) ) ;
180
181
break ;
181
182
}
182
183
continue ;
@@ -199,7 +200,7 @@ fn start_method_handler_thread(
199
200
// exited.
200
201
control_tx
201
202
. send ( ( ) )
202
- . unwrap_or_else ( |err| debug ! ( "Failed to try send {:?}" , err) ) ;
203
+ . unwrap_or_else ( |err| debug ! ( "Failed to send {:?}" , err) ) ;
203
204
break ;
204
205
}
205
206
continue ;
@@ -217,7 +218,7 @@ fn start_method_handler_thread(
217
218
// exited.
218
219
control_tx
219
220
. send ( ( ) )
220
- . unwrap_or_else ( |err| debug ! ( "Failed to try send {:?}" , err) ) ;
221
+ . unwrap_or_else ( |err| debug ! ( "Failed to send {:?}" , err) ) ;
221
222
break ;
222
223
}
223
224
}
@@ -471,6 +472,9 @@ impl Server {
471
472
break ;
472
473
}
473
474
}
475
+ // drop the control_rx, thus all of the method handler threads would
476
+ // terminated.
477
+ drop ( control_rx) ;
474
478
// drop the res_tx, thus the res_rx would get terminated notification.
475
479
drop ( res_tx) ;
476
480
handler. join ( ) . unwrap_or ( ( ) ) ;
0 commit comments