@@ -8,7 +8,7 | |||||
8 | No newline at end of file |
|
8 | ||
9 | class ABSClient: No newline at end of file |
|
9 | class ABSClient: | |
10 |
|
10 | |||
No newline at end of file |
|
11 | def __init__(self,ipSource="localhost", ipDestino="192.168.1.117", portDestino=7000): No newline at end of file | ||
11 | def __init__(self,ipSource="localhost", ipDestino="192.168.1.255", portDestino=7000): No newline at end of file |
|
|||
12 | No newline at end of file |
|
12 | ||
13 | self.ipSource = ipSource No newline at end of file |
|
13 | self.ipSource = ipSource | |
14 | self.ipDestino = ipDestino No newline at end of file |
|
14 | self.ipDestino = ipDestino |
@@ -1,7 +1,13 | |||||
1 | import socket No newline at end of file |
|
1 | import socket | |
|
2 | import select No newline at end of file | |||
2 | No newline at end of file |
|
3 | ||
3 | dgramSock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM ) No newline at end of file |
|
4 | dgramSock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM ) | |
4 |
|
5 | |||
No newline at end of file |
|
6 | #dgramSock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) | ||
5 | dgramSock.sendto( "Hello World\n", ('', 23000) ) No newline at end of file |
|
No newline at end of file | ||
|
7 | #dgramSock.setblocking(0) | |||
|
No newline at end of file | ||||
|
8 | dgramSock.sendto( "Hello World\n", ('192.168.1.117', 7000) ) | |||
|
No newline at end of file | ||||
|
9 | ready = select.select ([dgramSock],[],[],35) | |||
|
No newline at end of file | ||||
|
10 | if ready[0]: No newline at end of file | |||
6 | print dgramSock.recv( 100 ) No newline at end of file |
|
11 | print dgramSock.recv( 100 ) | |
7 | dgramSock.close() No newline at end of file |
|
12 |
General Comments 0
You need to be logged in to leave comments.
Login now