Well, i created a basic Golang TCP Socket. Im connecting to it via putty, with the connection type telnet. What i want to do is make commands. Simple as if the command is "hello" return a "hi" on the conn via putty. When entering this return a conn.Write to the putty.
Socket Code:
package main
import (
"net"
)
import "fmt"
import "bufio"
func main() {
fmt.Println("Start server...")
fmt.Println(net.IPv4Mask(255, 255, 255, 0))
// listen on port 14274
ln, _ := net.Listen("tcp", ":14274")
// accept connection
conn, _ := ln.Accept()
// run loop forever (or until ctrl-c)
for {
// get message, output
message, _ := bufio.NewReader(conn).ReadString('\n')
fmt.Print("Message Received:", string(message))
}
}