I don't know what you really want, but look at Twisted.
http://twistedmatrix.com
I am beginner at using python language.
I mean i am implementing that in a windows based machine and wanted
to transfer files over the LAN. I have written down two files as
client.py and server.py . I ran these files at two different Computers
in the LAN and I was able to send small chunks of messages( like
chat).
I was successful in establishing connection and sending small
messages. But now i want to transfer a complete file with out using
the ftplib(FTP LIBRARY) in python.
The files look like this.i hope this would help.
______________________________________________
# Server program
from socket import *
# Set the socket parameters
host = "117.105.224.94"
port = 21567
buf = 1024
addr = (host,port)
# Create socket and bind to address
UDPSock = socket(AF_INET,SOCK_DGRAM)
UDPSock.bind(addr)
# Receive messages
while 1:
data,addr = UDPSock.recvfrom(buf)
if not data:
print "Client has exited!"
break
else:
print "\nReceived message '", data,"'"
# Close socket
UDPSock.close()
__________________________________________________
# Client program
from socket import *
# Set the socket parameters
host = "117.105.224.94"
port = 21567
buf = 1024
addr = (host,port)
# Create socket
UDPSock = socket(AF_INET,SOCK_DGRAM)
def_msg = "===Enter message to send to server===";
print "\n",def_msg
# Send messages
while (1):
data = raw_input('>> ')
if not data:
break
else:
if(UDPSock.sendto(data,addr)):
print "Sending message '",data,"'....."
# Close socket
UDPSock.close()
_____________________________________________________________