You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
383 B
26 lines
383 B
2 weeks ago
|
package testUnit
|
||
|
|
||
|
import (
|
||
|
"goUpload/dbHelper"
|
||
|
"strconv"
|
||
|
"testing"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
func TestUDP_push(t *testing.T) {
|
||
|
udp := dbHelper.UdpHelper{
|
||
|
Host: "10.8.30.110",
|
||
|
Port: 8888,
|
||
|
}
|
||
|
udp.Initial()
|
||
|
udp.Publish([]byte("123456"))
|
||
|
|
||
|
var bytes []byte
|
||
|
for i := 0; i < 5; i++ {
|
||
|
bytes = append(bytes, strconv.Itoa(i)...)
|
||
|
udp.Publish(bytes)
|
||
|
time.Sleep(time.Second)
|
||
|
}
|
||
|
udp.Close()
|
||
|
}
|