-
-
Save amd64bit/aa7210b85b4a1451ed8a1bd82114f56a to your computer and use it in GitHub Desktop.
Revisions
-
glegoux revised this gist
Aug 29, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,7 +15,7 @@ UDP_PORT = 8000 # listen for UDP messages server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP) server.bind((UDP_IP_ADDRESS, UDP_PORT)) print("Serving UDP on {} port {} ...".format(UDP_IP_ADDRESS, UDP_PORT)) -
glegoux revised this gist
Aug 29, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,4 +21,4 @@ while True: data, addr = server.recvfrom(1024) print("Received message: '{}'".format(data.decode('utf-8'))) -
glegoux revised this gist
Aug 29, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,4 +21,4 @@ while True: data, addr = server.recvfrom(1024) print("Message: {}".format(data.decode('utf-8'))) -
glegoux revised this gist
Aug 29, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -21,4 +21,4 @@ while True: data, addr = server.recvfrom(1024) print("Message: {}".format(data.decode('utf-8')) -
glegoux revised this gist
Aug 29, 2017 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,11 @@ # # udpserver.py # # See Gist udpclient.py to send a UDP message. # # Run UDP server on 127.0.0.1 port 8000. # # usage: python3 udpserver.py if __name__ == "__main__": import socket -
glegoux revised this gist
Aug 29, 2017 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,8 @@ # listen for UDP messages server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) server.bind((UDP_IP_ADDRESS, UDP_PORT)) print("Serving UDP on {} port {} ...".format(UDP_IP_ADDRESS, UDP_PORT)) while True: data, addr = server.recvfrom(1024) print("Message: {}", data) -
glegoux revised this gist
Aug 29, 2017 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,11 +5,13 @@ # See Gist udpclient.py. if __name__ == "__main__": import socket UDP_IP_ADDRESS = "127.0.0.1" UDP_PORT = 8000 # listen for UDP messages server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) server.bind((UDP_IP_ADDRESS, UDP_PORT)) while True: -
glegoux revised this gist
Aug 29, 2017 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,11 +7,11 @@ if __name__ == "__main__": # listen for UDP messages server = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) UDP_IP_ADDRESS = "127.0.0.1" UDP_PORT = 8000 server.bind((UDP_IP_ADDRESS, UDP_PORT)) while True: data, addr = server.recvfrom(1024) print("Message: {}", data) -
glegoux revised this gist
Aug 29, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ #!/usr/bin/env python3 # # udpserver.py # -
glegoux revised this gist
Aug 29, 2017 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,4 +14,4 @@ while True: data, addr = serverSock.recvfrom(1024) print("Message: {}", data) -
glegoux created this gist
Aug 29, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ #!/usr/bin/env bash # # udpserver.py # # See Gist udpclient.py. if __name__ == "__main__": # listen for UDP messages serverSock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) UDP_IP_ADDRESS = "127.0.0.1" UDP_PORT = 8000 serverSock.bind((UDP_IP_ADDRESS, UDP_PORT)) while True: data, addr = serverSock.recvfrom(1024) print "Message: ", data