-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathudpserver.py
More file actions
executable file
·37 lines (26 loc) · 817 Bytes
/
udpserver.py
File metadata and controls
executable file
·37 lines (26 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/python
# -*- coding: utf-8 -*-
'''
Author: Robin David
License: GNU GPLv3
Repo: https://github.com/RobinDavid
Copyright (c) 2012 Robin David
PyStack is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
any later version http://www.gnu.org/licenses/.
'''
import pystack.pystack_socket as socket
HOST = '192.168.0.21' # The remote host
#HOST = "www.google.fr"
PORT = 7777 # The same port as used by the server
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.bind(("localhost",PORT))
while True:
data = s.recvfrom(512)
if data[0].startswith("quit"):
break
else:
print(data)
s.close()
s.stop() #To stop stack