Skip to content

Instantly share code, notes, and snippets.

@outworlder
Created March 3, 2011 16:47
Show Gist options
  • Select an option

  • Save outworlder/853069 to your computer and use it in GitHub Desktop.

Select an option

Save outworlder/853069 to your computer and use it in GitHub Desktop.
package main
import "fmt"
import "rpc/jsonrpc"
import "net"
import "time"
type Message struct {
message string
pid int
date time.Time // Eww.
}
func main() {
running := true
socket,_ := net.Listen("tcp", ":9999")
for running {
listener, _ := socket.Accept()
defer socket.Close()
go func() {
fmt.Println("Connection received.")
jsonrpc.ServeConn(listener)
}()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment