Ejemplo n.º 1
0
func TestInitClient2(t *testing.T) {
	socket := thrift.NewTSocketFromAddrTimeout(addr, TIMEOUT)
	transport := thrift.NewTFramedTransport(socket)
	var protocol thrift.TProtocol = thrift.NewTBinaryProtocolTransport(transport)
	protocol = thrift.NewTMultiplexedProtocol(protocol, "SecondService")
	secondClient = MuliplexedProtocolTest.NewSecondClientProtocol(transport, protocol, protocol)
	err := transport.Open()
	if err != nil {
		t.Fatal("Unable to open client socket", err)
	}
}
Ejemplo n.º 2
0
//create client without service prefix
func createLegacyClient(t *testing.T) *MuliplexedProtocolTest.SecondClient {
	socket := thrift.NewTSocketFromAddrTimeout(addr, TIMEOUT)
	transport := thrift.NewTFramedTransport(socket)
	var protocol thrift.TProtocol = thrift.NewTBinaryProtocolTransport(transport)
	legacyClient := MuliplexedProtocolTest.NewSecondClientProtocol(transport, protocol, protocol)
	err := transport.Open()
	if err != nil {
		t.Fatal("Unable to open client socket", err)
	}
	return legacyClient
}