func Serve(host string, handler Function, timeout int) error {
	l, err := net.Listen("tcp", host)
	if err != nil {
		return err
	}
	defer l.Close()
	for {
		conn, err := l.Accept()
		if err != nil {
			log.Println(err)
			continue
		}
		go process(conn, handler, timeout)
	}
}
Serve starts a remote function server. Incomming requests should be handled
by the given Function. This version of Serve doesn't work with AddRoute.
package ogdlrf
import (
	"encoding/binary"
	"log"
	"net"
	"time"
	"github.com/rveen/ogdl"
)
type Server struct {
	Host     string
	Timeout  int
	rtable   map[string]Function
	Protocol int
}
var notFound = ogdl.FromString("error notFound")
func (srv *Server) AddRoute(path string, f Function) {
	if srv.rtable == nil {
		srv.rtable = make(map[string]Function)
	}
	srv.rtable[path] = f
}
func (srv *Server) router() Function {
	return func(c net.Conn, g *ogdl.Graph) *ogdl.Graph {
		if len(g.Out) == 0 {
			return notFound
		}
		s := g.Out[0].ThisString()
		h := srv.rtable[s]
		if h != nil {
			return h(c, g)
		}
		return notFound
	}
}
func (srv *Server) Serve() error {
	if srv.Protocol == 1 {
		return Serve1(srv.Host, srv.router(), srv.Timeout)
	}
	return Serve(srv.Host, srv.router(), srv.Timeout)
}