Re: HELP!!! How do I send an ACK packet in UDP?????
- From: myersoft@xxxxxxxxx
- Date: 25 Jul 2006 15:48:13 -0700
Yes, you were right it was already there (sorry, my mistake), the
bigger problem is how do I send an ack packet????????
Joe Knapka wrote:
myersoft@xxxxxxxxx wrote:
I need my udp server to send an ACK back to the client when it
successfully receives data from the client to let it know not to retry
the send (yes, I do know this is how TCP works but must be in UDP)
I am using this example code I found on the net for the server, I need
to figure out how to get the ip and port that the client transmitted
from and return an ack response. Any help would be greatly
appreciated..........
from socket import *
# Set the socket parameters
host = "localhost"
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)
Um... There's the sender's address, right there,
per the documentation for recvfrom(), which you
seem to have read, since you know recvfrom()
returns a 2-item sequence.
No doubt you realized that seconds after hitting
"send".
-- JK
.
- Follow-Ups:
- Re: HELP!!! How do I send an ACK packet in UDP?????
- From: Rob Sinclar
- Re: HELP!!! How do I send an ACK packet in UDP?????
- From: Joe Knapka
- Re: HELP!!! How do I send an ACK packet in UDP?????
- Prev by Date: xmlrpclib and methods declared at runtime
- Next by Date: Re: Coding style
- Previous by thread: xmlrpclib and methods declared at runtime
- Next by thread: Re: HELP!!! How do I send an ACK packet in UDP?????
- Index(es):
Relevant Pages
|