// im a web connector package main import ( "http"; "io"; //"./dbibridge"; "./benchcontroller"; "fmt"; ) var comin chan int; var comout chan int; // hello world, the web server func HelloServer(c *http.Conn, req *http.Request) { comout <- 1; io.WriteString(c, "
\n"); // fucking go, i just wanna consume the incoming data, but it forces me to do something with it... cunt of a language k := <- comin; fmt.Printf("%d\n", k); } func main() { //var Dbconn *dbibridge.DBIConnection; //Dbconn = dbibridge.DBICreate(); //dbibridge.DBIConnect(Dbconn, "mysql", "localhost", "root", "password", "zm"); //dbibridge.ExecSQL(Dbconn, "create table asdf (asdf int)"); //dbibridge.DBIDisconnect(Dbconn); comin = make(chan int); comout = make(chan int); bc := benchcontroller.CreateController(); go benchcontroller.MainLoop(bc, comout, comin); http.Handle("/hello", http.HandlerFunc(HelloServer)); err := http.ListenAndServe(":12345", nil); if err != nil { panic("ListenAndServe: ", err.String()) } }