Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

UDP Sockets 1

Status
Not open for further replies.

Tarwn

Programmer
Mar 20, 2001
5,787
US
I ran into the Windows UDP socket issue the other night. basically I was playing with a script to pull in data from a foreign master server and after messing with it a little (and several hours of searching for badly documented protocol on the partof the master server), I ran into the fact that you can't use the standard python sockets in windows using UDP.
I did a little searching here and there, noticed that some people are resorting to winsock, noticed a minor reference somewhere to win32file, and realized if I really wanted to I could write my own socket interface, but would really rather not.

I'd appreciate any advise people would have on this subject. Ie, isssues you may have run into in the past trying to do this or packages you have found to work better (if there are others), etc.
 
Explanation real quick:
For some reason when I think winsock i think of the COM object. At that point I start getting nervous and try to change the subject and fervently attempt to think of something other than the past horrors of VBA. Sorry for the "Resorting" in the above explanation :p
 
mmmm... strange.

I did not play with UDP under Python, but odds are that UDP works under Windows with Python.
(There are several UDP-based Python program which run under Windows.)

Basically, you use the example below:

Except that you use SOCK_DGRAM instead of SOCK_STREAM.

Like you, I would not like to dig into the win32all modules to re-create an UDP module. Yuk !
 
Ahh...I haven't played with sockets in a few years, I was thinking that I needed to use AF_Unix to have UDP protocol. Thanks so much for clearing that up. Now that I realize where my error was, I feel rather ignorant :)

Basically, than
SOCK_STREAM with the AF_INET should be TCP and
SOCK_DGRAM with AF_INET should be UDP

I'll try and give it a shot tonight and see if I can get it working now that I have a little more info. Thanks seb,

-Tarwn

01000111 01101111 01110100 00100000 01000011 01101111 01100110 01100110 01100101 01100101 00111111
minilogo.gif alt=tiernok.com
The never-completed website
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top