2008-07-31 20:58:51 +00:00
|
|
|
import socket
|
2008-07-30 20:35:58 +00:00
|
|
|
|
2008-07-31 20:58:51 +00:00
|
|
|
#maybe put this isnt' a class
|
2008-07-30 20:35:58 +00:00
|
|
|
|
|
|
|
|
#returns true if packet was sent successfully
|
|
|
|
|
def send_packet(socket, send_buffer, size, ip_addr, port):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
#returns message and size, or None if error
|
2008-07-31 06:36:15 +00:00
|
|
|
def receive_packet(socket):
|
2008-07-30 20:35:58 +00:00
|
|
|
pass
|
2008-07-31 20:58:51 +00:00
|
|
|
|
|
|
|
|
def start_udp_connection(port):
|
|
|
|
|
""" Starts a udp connection, returning socket and port. """
|
|
|
|
|
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
|
|
|
#error check - make sure sock is good
|
|
|
|
|
|
|
|
|
|
#will probably be other setup for this
|
|
|
|
|
return sock
|
|
|
|
|
|
|
|
|
|
|