@@ -4,7 +4,7 | |||||
4 | No newline at end of file |
|
4 | ||
5 | class ABSServer: No newline at end of file |
|
5 | class ABSServer: | |
6 |
|
6 | |||
No newline at end of file |
|
7 | def __init__(self,ipSource="localhost", ipDestino="192.168.1.117", portDestino=7000, ipDestino2="192.168.1.255", portDestino2=5500, ftpPortDestino=None): No newline at end of file | ||
7 | def __init__(self,ipSource="localhost", ipDestino="192.168.1.255", portDestino=7000, ipDestino2="192.168.1.255", portDestino2=5500, ftpPortDestino=None): No newline at end of file |
|
|||
8 | No newline at end of file |
|
8 | ||
9 | self.ipSource = ipSource No newline at end of file |
|
9 | self.ipSource = ipSource | |
10 | self.ipDestino = ipDestino No newline at end of file |
|
10 | self.ipDestino = ipDestino |
@@ -1,4 +1,5 | |||||
1 |
import socket |
|
1 | import socket | |
|
2 | import time No newline at end of file | |||
2 | No newline at end of file |
|
3 | ||
3 | host = "192.168.1.117" No newline at end of file |
|
4 | host = "192.168.1.117" | |
4 | s = socket.socket() No newline at end of file |
|
5 | s = socket.socket() |
@@ -1,9 +1,14 | |||||
1 | import socket No newline at end of file |
|
1 | import socket | |
|
2 | import time No newline at end of file | |||
2 | No newline at end of file |
|
3 | ||
3 | dgramSock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM ) |
|
4 | dgramSock = socket.socket( socket.AF_INET, socket.SOCK_DGRAM ) | |
No newline at end of file |
|
5 | dgramSock.bind( ('192.168.1.117', 7000) ) No newline at end of file | ||
4 | dgramSock.bind( ('', 23000) ) No newline at end of file |
|
|||
5 | No newline at end of file |
|
6 | ||
6 | while 1: No newline at end of file |
|
7 | while 1: | |
7 | No newline at end of file |
|
8 | ||
8 | msg, (addr, port) = dgramSock.recvfrom( 100 ) No newline at end of file |
|
9 | msg, (addr, port) = dgramSock.recvfrom( 100 ) | |
|
10 | ||||
|
No newline at end of file | ||||
|
11 | # time.sleep(30) #not ok at the client | |||
|
No newline at end of file | ||||
|
12 | # time.sleep(10) #ok | |||
|
No newline at end of file | ||||
|
13 | print msg + 'to: ' + addr + ':' + str (port) No newline at end of file | |||
9 | dgramSock.sendto( msg, (addr, port) ) No newline at end of file |
|
14 | dgramSock.sendto( msg, (addr, port) ) |
General Comments 0
You need to be logged in to leave comments.
Login now