mirror of
				https://github.com/yggdrasil-network/yggdrasil-go.git
				synced 2025-11-04 11:15:07 +03:00 
			
		
		
		
	Show both UDP and TCP listen addresses in stdout (#51)
This commit is contained in:
		
							parent
							
								
									7489704788
								
							
						
					
					
						commit
						1155816df8
					
				
					 2 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -51,7 +51,7 @@ func (iface *tcpInterface) init(core *Core, addr string) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (iface *tcpInterface) listener() {
 | 
					func (iface *tcpInterface) listener() {
 | 
				
			||||||
	defer iface.serv.Close()
 | 
						defer iface.serv.Close()
 | 
				
			||||||
	iface.core.log.Println("Listening on:", iface.serv.Addr().String())
 | 
						iface.core.log.Println("Listening for TCP on:", iface.serv.Addr().String())
 | 
				
			||||||
	for {
 | 
						for {
 | 
				
			||||||
		sock, err := iface.serv.AcceptTCP()
 | 
							sock, err := iface.serv.AcceptTCP()
 | 
				
			||||||
		if err != nil {
 | 
							if err != nil {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -265,6 +265,7 @@ func (iface *udpInterface) handlePacket(msg []byte, addr connAddr) {
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func (iface *udpInterface) reader() {
 | 
					func (iface *udpInterface) reader() {
 | 
				
			||||||
 | 
						iface.core.log.Println("Listening for UDP on:", iface.sock.LocalAddr().String())
 | 
				
			||||||
	bs := make([]byte, 65536) // This needs to be large enough for everything...
 | 
						bs := make([]byte, 65536) // This needs to be large enough for everything...
 | 
				
			||||||
	for {
 | 
						for {
 | 
				
			||||||
		n, udpAddr, err := iface.sock.ReadFromUDP(bs)
 | 
							n, udpAddr, err := iface.sock.ReadFromUDP(bs)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue