Make Select a singleton
It's going to manipulate process-global signal state, so multiple instances do not make sense.
This commit is contained in:
committed by
Keith Winstein
parent
bb651581a7
commit
768d4ce797
@@ -58,7 +58,7 @@ int main( int argc, char *argv[] )
|
||||
fprintf( stderr, "Port bound is %d, key is %s\n", n->port(), n->get_key().c_str() );
|
||||
|
||||
if ( server ) {
|
||||
Select sel;
|
||||
Select &sel = Select::get_instance();
|
||||
sel.add_fd( n->fd() );
|
||||
uint64_t last_num = n->get_remote_state_num();
|
||||
while ( true ) {
|
||||
@@ -100,7 +100,7 @@ int main( int argc, char *argv[] )
|
||||
exit( 1 );
|
||||
}
|
||||
|
||||
Select sel;
|
||||
Select &sel = Select::get_instance();
|
||||
sel.add_fd( STDIN_FILENO );
|
||||
sel.add_fd( n->fd() );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user