| | 27 | ||= Transmitter =||= Receiver =|| |
| | 28 | |-------------------------------------------------------- |
| | 29 | {{{#!td style="border: 0px; font-size: 90%" |
| | 30 | {{{ |
| | 31 | class dsc_pkt_src(object): |
| | 32 | def __init__(self, server, port=5123 ): |
| | 33 | self.pkt_size = 1440 # 1440 bytes of data |
| | 34 | self.pkt_server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
| | 35 | self.pkt_server_socket.connect((server,port)) |
| | 36 | self.MESSAGE = struct.pack('!l', self.pkt_size) |
| | 37 | self.pkt_server_socket.send(self.MESSAGE) |
| | 38 | |
| | 39 | def read(self): |
| | 40 | try: |
| | 41 | data = self.pkt_server_socket.recv(self.pkt_size) |
| | 42 | except socket.error: |
| | 43 | print "Connection to packet server closed" |
| | 44 | return '' |
| | 45 | self.pkt_server_socket.send(self.MESSAGE) |
| | 46 | return data |
| | 47 | }}} |
| | 48 | }}} |
| | 49 | {{{#!td style="border: 0px; font-size: 90%" |
| | 50 | {{{ |
| | 51 | class dsc_pkt_sink(object): |
| | 52 | def __init__(self, server, port=5125): |
| | 53 | self.pkt_sink_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
| | 54 | self.pkt_sink_socket.connect((server,port)) |
| | 55 | |
| | 56 | def send(self, payload): |
| | 57 | try: |
| | 58 | self.pkt_sink_socket.recv(4) |
| | 59 | self.pkt_sink_socket.send(payload) |
| | 60 | except socket.error: |
| | 61 | print "Connection to packet sink closed" |
| | 62 | }}} |
| | 63 | }}} |
| | 64 | |
| | 65 | Teams are also required to label their image with the image name they intend to use for submission stored in file named '''/.orbit_image''' on the root of the filesystem. For example, if the team itends to submit image with image name '''orbit-bot.ndz''' the /.orbit_image shoudl contain '''orbit-bot'''. |