package net import ( "net" "sync" ) type SimpleNatClient struct { mu sync.RWMutex cmdTCPConn net.Conn cmdUDPConn *net.UDPAddr ServiceTarget string CmdTarget string tcpAlived bool } func (s *SimpleNatClient) tcpCmdConn() net.Conn { s.mu.RLock() defer s.mu.RUnlock() return s.cmdTCPConn } func (s *SimpleNatClient) tcpCmdConnAlived() bool { s.mu.RLock() defer s.mu.RUnlock() return s.tcpAlived }