simplFT/server/simplFTP.go

34 lines
526 B
Go
Raw Normal View History

2017-10-20 15:08:25 +00:00
package main
import (
2017-10-28 20:40:24 +00:00
"log"
"net"
"github.com/metonimie/simpleFTP/server/server"
2017-10-20 15:08:25 +00:00
)
func main() {
listener, err := net.Listen("tcp", "localhost:8080")
if err != nil {
log.Fatal(err)
}
log.Println("Hello world!")
log.Println("Running on:", "localhost", "port", "8080")
for {
2017-10-20 15:08:25 +00:00
conn, err := listener.Accept()
if err != nil {
log.Print(err)
continue
}
client := server.FTPClient{}
client.SetStack(server.MakeStringStack(30))
client.SetConnection(conn)
go server.HandleConnection(&client)
2017-10-20 15:08:25 +00:00
}
}