blocking/non-blocking socket question.

Mike Kaplinskiy mike.kaplinskiy at gmail.com
Thu Jul 23 23:02:01 CDT 2009


On Thu, Jul 23, 2009 at 10:28 PM, Juan Lang<juan.lang at gmail.com> wrote:
>> I think what Rein means is that the unix socket fd backing the windows
>> socket handle is always non-blocking - and if he is, he may be
>> correct:
>>
>> http://source.winehq.org/source/server/sock.c#L578 &&
>> http://source.winehq.org/source/server/sock.c#L663
>
> That's true, but it depends on whether the blocking state is
> transferred across a dup() call.  The file descriptor used in a dll
> comes from wine_server_handle_to_fd:
> http://source.winehq.org/source/dlls/ntdll/server.c#L635
>
> I confess I don't know whether it is.  But the existence of the
> do_blocking call strongly implies that it is, doesn't it?
> --Juan
>

It definitely seems that way. Also, if the blocking state is not
transferred then those fcntl's wouldn't have any effect and hence we
wouldn't have the bug. But I agree with you that the documentation is
incredibly vague (what is "state"?) with regards to what the
implemented behavior should be. It seems it is just a hard link for
handles. Besides if the state is not transferred, those fcntl's
wouldn't have any effect as the duped socket is closed when released.

Rein, I think you can safely make a patch for this bug. In the worst
case Alexandre will just not take it. ;)

Mike.



More information about the wine-devel mailing list