mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 03:05:07 +03:00 
			
		
		
		
	Check if accepting socket produced an error
This commit is contained in:
		
							parent
							
								
									2cd373fc1e
								
							
						
					
					
						commit
						53be1b02f3
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -140,6 +140,10 @@ func (iface *tcpInterface) listener() {
 | 
			
		|||
	iface.core.log.Println("Listening for TCP on:", iface.serv.Addr().String())
 | 
			
		||||
	for {
 | 
			
		||||
		sock, err := iface.serv.Accept()
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			iface.core.log.Println("Failed to accept connection:", err)
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
		select {
 | 
			
		||||
		case <-iface.serv_stop:
 | 
			
		||||
			iface.core.log.Println("Stopping listener")
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue