예제 #1
0
func Secure(processor *tutorial.CalculatorProcessor) {
	addr, _ := net.ResolveTCPAddr("tcp", "localhost:9091")
	serverTransport, _ := thrift.NewTNonblockingServerSocketAddr(addr)
	server := thrift.NewTSimpleServer2(processor, serverTransport)
	fmt.Print("Starting the secure server... on ", addr, "\n")
	server.Serve()
	fmt.Print("Done with the secure server\n")
}
예제 #2
0
func TestInitOneway(t *testing.T) {
	var err error
	addr = findPort()
	serverTransport, err := thrift.NewTServerSocketTimeout(addr.String(), TIMEOUT)
	if err != nil {
		t.Fatal("Unable to create server socket", err)
	}
	processor := onewaytest.NewOneWayProcessor(&impl{})
	server = thrift.NewTSimpleServer2(processor, serverTransport)

	go server.Serve()
}