On Sat, Feb 26, 2011 at 6:37 AM, Senthil Kumaran <[email protected]>wrote:
> On Fri, Feb 25, 2011 at 08:42:31PM +0530, kunal ghosh wrote:
> > step 1: holepunch , send UDP packet from receiver to sender
> > from socket import *
> > s = socket(AF_INET,SOCK_DGRAM)
> > host = "<receiver ip>"
> > port = <receiver port>
> > s.bind((host,port))
> > s.sendto("Message",("<sender ip>",<sender port>))
> >
> > here i get the following error
> > *error: [Errno 22] Invalid argument*
> > i dunno how to resolve this issue.
>
> Don't use the bind call in the UDP client.Make sure your ipaddress is
> proper.Otherwise your code looks fine.
>
I am using the bind call to make sure i use a specific source port to send
the message.
Is there any other way that can be achieved ?
How can the sender know which port was used to send the packet , after the
packet was sent ?
It is necessary for the sender to know so that it can start listening on the
same port , (this is necessary for
hole punching to work)
>
> --
> Senthil
> _______________________________________________
> BangPypers mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/bangpypers
>
--
regards
-------
Kunal Ghosh
Dept of Computer Sc. & Engineering.
Sir MVIT
Bangalore,India
permalink: member.acm.org/~kunal.t2 <http://member.acm.org/%7Ekunal.t2>
Blog:kunalghosh.wordpress.com
Website:www.kunalghosh.net46.net
_______________________________________________
BangPypers mailing list
[email protected]
http://mail.python.org/mailman/listinfo/bangpypers