changed udp packet format and storage struct, added python udp packet sender (incomplete)
parent
7deaabdd20
commit
2b596aee7d
|
@ -0,0 +1,22 @@
|
|||
# Client program
|
||||
|
||||
from socket import *
|
||||
|
||||
# Set the socket parameters
|
||||
host = "localhost"
|
||||
port = 4321
|
||||
buf = 382
|
||||
addr = (host,port)
|
||||
|
||||
# Create socket
|
||||
UDPSock = socket(AF_INET,SOCK_DGRAM)
|
||||
|
||||
# Send messages
|
||||
while (1):
|
||||
data = raw_input('>> ')
|
||||
if not data:
|
||||
break
|
||||
else:
|
||||
UDPSock.sendto(data,addr)
|
||||
|
||||
UDPSock.close()
|
|
@ -1,6 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
while [ 1 ]
|
||||
do
|
||||
echo "$1" | cat - display | netcat -q 0.1 -u 127.0.0.1 4321
|
||||
done
|
Loading…
Reference in New Issue