package main

import (
	"fmt"
	"net"
	"os"
)

const (
	banner = "\n*** UNAUTHORIZED ACCESS PROHIBITED ***\n*** YOUR CONNECTION ATTEMPT HAS BEEN LOGGED ***\n\n"
	port   = "9999"
)

func handleConnection(conn net.Conn) {
	conn.Write([]byte(banner))
	conn.Close()
}

func main() {
	ln, err := net.Listen("tcp", ":"+port)
	if err != nil {
		fmt.Println("Error starting banner service:", err)
		os.Exit(1)
	}
	defer ln.Close()

	for {
		conn, err := ln.Accept()
		if err != nil {
			continue
		}
		go handleConnection(conn)
	}
}
