Sockets: code works locally but fails over LAN

Grant Edwards grante at visi.com
Wed Aug 31 16:31:57 EDT 2005


On 2005-08-31, Bryan Olson <fakeaddress at nowhere.org> wrote:

>>>2. I'm not at all sure that accessing the same socket object
>>>simultaneously from two threads is safe.
>>
>> It's OK under Unix.  Having one thread handle rx and a
>> different one handle tx is a pretty widely used method.
>>
>> Don't know about Win32...
>
> A thread for send and one for recv is also frequently used
> with Winsock. Can anyone vouch for the Python wrapping?

The last time I looked, it was a pretty thin wrapper, and
shouldn't cause a problem.  I just looked at 2.3.5 sources.  [I
think the timeout feature is new since I hacked on socketmodule.c 
last.] I don't really see anything troublesome.

Basically, socket.recv() just calls recv() and socket.send()
just calls send().

-- 
Grant Edwards                   grante             Yow!  MY income is ALL
                                  at               disposable!
                               visi.com            



More information about the Python-list mailing list