You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It works on newer distributions like Windows 10. For older distributions like Windows 2008 R2 and Windows 7, the server pending on L35 but the client is connected.
Using go-winio v0.6.1 and Go program built with 1.20.13
Finding
I used dlv to look around and it turned out that connectNamedPipe can't get ERROR_IO_CONNECTED on older platforms. It got ERROR_IO_PENDING. Thus the following asyncIO call is pending forever (so does connectPipe and Accept). On the other hand, newer platforms can get ERROR_IO_CONNECTED.
I'm not sure if the connectNamedPipe call is implemented differently on platforms like Windows 2008 R2 and Windows 10.
I refer to changes: #125 and #80 and I can fix this issue by adding the following code snippets in ListenPipe after the makeServerPipeHandle call:
The reason for ignoring windows.ERROR_PIPE_BUSY is that we got this error when a real client is connecting before the dummy client, but we don't care about this error as the dummy client will be closed soon. The idea is to call fs.CreateFile to keep the pipe server "awake".
Questions
Could someone provide me with an idea about the issue?
Does the fix (the dummy connection approach) make good sense?
The text was updated successfully, but these errors were encountered:
I've reproduced this behaviour (go-winio v0.5.2 built with go 1.20.10) and applied the fix and it resolved my issue. It was working on go-winio v0.4.12.
Though I'm not an expert on this area so I cannot comment on the fix itself.
How do we replicate the issue?
go-winio v0.6.1
and Go program built with1.20.13
Finding
I used
dlv
to look around and it turned out thatconnectNamedPipe
can't getERROR_IO_CONNECTED
on older platforms. It gotERROR_IO_PENDING
. Thus the followingasyncIO
call is pending forever (so doesconnectPipe
andAccept
). On the other hand, newer platforms can getERROR_IO_CONNECTED
.I'm not sure if the
connectNamedPipe
call is implemented differently on platforms like Windows 2008 R2 and Windows 10.I refer to changes: #125 and #80 and I can fix this issue by adding the following code snippets in ListenPipe after the
makeServerPipeHandle
call:The reason for ignoring
windows.ERROR_PIPE_BUSY
is that we got this error when a real client is connecting before the dummy client, but we don't care about this error as the dummy client will be closed soon. The idea is to callfs.CreateFile
to keep the pipe server "awake".Questions
The text was updated successfully, but these errors were encountered: