9
0
Fork 0

contrib: Add smalltalk script to send send UDP messages

These messages are a SLTM and a TRA message that we want
to test on the udt relay receiver. The speciality is the header.
This commit is contained in:
Holger Hans Peter Freyther 2010-12-08 10:06:52 +01:00
parent 8fa8e584dd
commit e15fa4cafe
1 changed files with 25 additions and 0 deletions

25
contrib/TestSender.st Normal file
View File

@ -0,0 +1,25 @@
PackageLoader fileInPackage: 'Sockets'.
Eval [
| msg socket datagram addr |
addr := Sockets.SocketAddress byName: '127.0.0.1'.
socket := Sockets.DatagramSocket local: '127.0.0.1' port: 5000.
datagram := Sockets.Datagram new.
datagram port: 1313.
datagram address: addr.
"SLTM"
msg := #(2 0 0 1 0 0 0 0 0 0 0
15 193 232 197 7 0 17
128 247 248 249 250 251
252 253 254 ) asByteArray.
datagram data: msg.
socket nextPut: datagram.
"TRA"
msg := #(2 0 0 1 0 0 0 0 0 0 0 6 192 232 197 7 0 23) asByteArray.
datagram data: msg.
socket nextPut: datagram.
]