Skip to content

Commit 8d7b58d

Browse files
authored
Merge pull request #64 from Tim-Zhang/change-api-server-restart
Change apis about server restart
2 parents d859795 + 6a7db4b commit 8d7b58d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/sync/server.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ impl Server {
316316
self
317317
}
318318

319-
pub fn start_listener(&mut self) -> Result<()> {
319+
pub fn start_listen(&mut self) -> Result<()> {
320320
let connections = self.connections.clone();
321321

322322
if self.listeners.is_empty() {
@@ -502,12 +502,12 @@ impl Server {
502502
"thread_count_default should biger than thread_count_min".to_string(),
503503
));
504504
}
505-
self.start_listener()?;
505+
self.start_listen()?;
506506
info!("server started");
507507
Ok(())
508508
}
509509

510-
pub fn shutdown_listen(mut self) -> Self {
510+
pub fn stop_listen(mut self) -> Self {
511511
self.listener_quit_flag.store(true, Ordering::SeqCst);
512512
close(self.monitor_fd.1).unwrap_or_else(|e| {
513513
warn!(
@@ -523,7 +523,7 @@ impl Server {
523523
self
524524
}
525525

526-
pub fn shutdown_connection(mut self) {
526+
pub fn disconnect(mut self) {
527527
info!("begin to shutdown connection");
528528
let connections = self.connections.lock().unwrap();
529529

@@ -543,7 +543,7 @@ impl Server {
543543
}
544544

545545
pub fn shutdown(self) {
546-
self.shutdown_listen().shutdown_connection();
546+
self.stop_listen().disconnect();
547547
}
548548
}
549549

0 commit comments

Comments
 (0)