func main() {
	go doSignal()

	port := flag.String("port", "7654", "The port to listen to tcp traffic on")
	flag.Parse()
	if ep := os.Getenv("PORT"); ep != "" {
		port = &ep
	}

	log.Printf("Starting TCP server, listening on port %s", *port)
	ln, err := net.Listen("tcp", ":"+*port)
	if err != nil {
		log.Fatalf("Could not start tcp server: %v", err)
	}
	defer ln.Close() // nolint: errcheck

	log.Print("Creating SDK instance")
	s, err := sdk.NewSDK()
	if err != nil {
		log.Fatalf("Could not connect to sdk: %v", err)
	}

	log.Print("Starting Health Ping")
	stop := make(chan struct{})
	go doHealth(s, stop)

	log.Print("Marking this server as ready")
	if err := s.Ready(); err != nil {
		log.Fatalf("Could not send ready message")
	}

	for {
		conn, err := ln.Accept()
		if err != nil {
			log.Printf("Unable to accept incoming tcp connection: %v", err)
		}
		go handleConnection(conn, stop, s)
	}
}
// main starts a TCP server that receives a message at a time
// (newline delineated), and echos the output.
main starts a TCP server that receives a message at a time
(newline delineated), and echos the output.
// main starts a TCP server that receives a message at a time // ( newline delineated ) and echos the output .
func main() {
	go doSignal()
	port := flag.String("port", "7654", "The port to listen to tcp traffic on")
	flag.Parse()
	if ep := os.Getenv("PORT"); ep != "" {
		port = &ep
	}
	log.Printf("Starting TCP server, listening on port %s", *port)
	ln, err := net.Listen("tcp", ":"+*port)
	if err != nil {
		log.Fatalf("Could not start tcp server: %v", err)
	}
	defer ln.Close() 
	log.Print("Creating SDK instance")
	s, err := sdk.NewSDK()
	if err != nil {
		log.Fatalf("Could not connect to sdk: %v", err)
	}
	log.Print("Starting Health Ping")
	stop := make(chan struct{})
	go doHealth(s, stop)
	log.Print("Marking this server as ready")
	if err := s.Ready(); err != nil {
		log.Fatalf("Could not send ready message")
	}
	for {
		conn, err := ln.Accept()
		if err != nil {
			log.Printf("Unable to accept incoming tcp connection: %v", err)
		}
		go handleConnection(conn, stop, s)
	}
}
func main ( ) { go doSignal ( ) port := flag . String ( " " , " " , " " ) flag . Parse ( ) if ep := os . Getenv ( " " ) ; ep != " " { port = & ep } log . Printf ( " " , * port ) ln , err := net . Listen ( " " , " " + * port ) if err != nil { log . Fatalf ( " " , err ) } defer ln . Close ( ) log . Print ( " " ) s , err := sdk . NewSDK ( ) if err != nil { log . Fatalf ( " " , err ) } log . Print ( " " ) stop := make ( chan struct { } ) go doHealth ( s , stop ) log . Print ( " " ) if err := s . Ready ( ) ; err != nil { log . Fatalf ( " " ) } for { conn , err := ln . Accept ( ) if err != nil { log . Printf ( " " , err ) } go handleConnection ( conn , stop , s ) } }
main starts a TCP server that receives a message at a time
(newline delineated), and echos the output.
main starts a TCP server that receives a message at a time ( newline delineated ) and echos the output .
// nolint: errcheck