// basic send/receive testing
basic send/receive testing
// basic send / receive testing
func TestPacket(t *testing.T) {
	server1Address := "tcp://127.0.0.1:9977"
	server2Address := "tcp://127.0.0.1:9978"
	delay := 1 * time.Second
	server1Name := "this is the #1 server"
	server2Name := "here is server two"
	client1Name := "client number one"
	client2Name := "the second client"
	listenSocket1, err := createSocket(plainSocket, server1Name, "")
	if nil != err {
		t.Fatalf("listen socket 2: err = %v", err)
	}
	defer listenSocket1.Close()
	listenSocket1.Bind(server1Address)
	listenSocket2, err := createSocket(plainSocket, server2Name, "")
	if nil != err {
		t.Fatalf("listen socket 2: err = %v", err)
	}
	defer listenSocket2.Close()
	listenSocket2.Bind(server2Address)
	outgoingSocket1, err := createSocket(plainSocket, client1Name, "")
	if nil != err {
		t.Fatalf("outgoing socket 1: err = %v", err)
	}
	defer outgoingSocket1.Close()
	outgoingSocket1.Connect(server1Address)
	outgoingSocket1.Connect(server2Address)
	outgoingSocket2, err := createSocket(plainSocket, client2Name, "")
	if nil != err {
		t.Fatalf("outgoing socket 2: err = %v", err)
	}
	defer outgoingSocket2.Close()
	outgoingSocket2.Connect(server1Address)
	outgoingSocket2.Connect(server2Address)
	clients := []socketKey{
		{outgoingSocket1, client1Name},
		{outgoingSocket2, client2Name},
	}
	servers := []socketKey{
		{listenSocket1, server1Name},
		{listenSocket2, server2Name},
	}
	sendReceive(t, clients, servers, delay)
}
func TestPacket ( t * testing . T ) { server1Address := " " server2Address := " " delay := 1 * time . Second server1Name := " " server2Name := " " client1Name := " " client2Name := " " listenSocket1 , err := createSocket ( plainSocket , server1Name , " " ) if nil != err { t . Fatalf ( " " , err ) } defer listenSocket1 . Close ( ) listenSocket1 . Bind ( server1Address ) listenSocket2 , err := createSocket ( plainSocket , server2Name , " " ) if nil != err { t . Fatalf ( " " , err ) } defer listenSocket2 . Close ( ) listenSocket2 . Bind ( server2Address ) outgoingSocket1 , err := createSocket ( plainSocket , client1Name , " " ) if nil != err { t . Fatalf ( " " , err ) } defer outgoingSocket1 . Close ( ) outgoingSocket1 . Connect ( server1Address ) outgoingSocket1 . Connect ( server2Address ) outgoingSocket2 , err := createSocket ( plainSocket , client2Name , " " ) if nil != err { t . Fatalf ( " " , err ) } defer outgoingSocket2 . Close ( ) outgoingSocket2 . Connect ( server1Address ) outgoingSocket2 . Connect ( server2Address ) clients := [ ] socketKey { { outgoingSocket1 , client1Name } , { outgoingSocket2 , client2Name } , } servers := [ ] socketKey { { listenSocket1 , server1Name } , { listenSocket2 , server2Name } , } sendReceive ( t , clients , servers , delay ) }
basic send/receive testing
basic send / receive testing
// use a specific IP:Port so client can use this - (for testing with tcp) //server1Address := "inproc://test_bilateral_packet_1" //server2Address := "inproc://test_bilateral_packet_2" //delay = 0 // plaintext names // Server 1 // -------- // Server 2 // -------- // Client 1 // -------- // Client 2 // -------- // tests // -----