Beispiel #1
0
func RunSender(t *testing.T, aSender *sender.Sender, sem chan<- int, messages []string) {
	for _, expected := range messages {
		time.Sleep(50 * time.Millisecond)
		_, err := aSender.Send([]byte(expected))
		if err != nil {
			t.Error("Error sending message:", err)
		}
	}
	sem <- 1
}
Beispiel #2
0
func RunSender(aSender *sender.Sender, sem chan<- int, messages []string) {
	for _, expected := range messages {
		fmt.Println("Sending message:", expected)
		_ = time.Sleep
		//		time.Sleep(50 * time.Millisecond)
		_, err := aSender.Send([]byte(expected))
		if err != nil {
			fmt.Println("Error sending message:", err)
		}
		fmt.Println("Sent message:", expected)
	}
	fmt.Println("Done sending")
	sem <- 1
}