Couple of questions about namedpipes

Hey All :slight_smile:

I’m trying to communicate from Julia to Python via namedpipes. I open a pipe in julia

julia> s = listen("\\\\.\\pipe\\p123")
Sockets.PipeServer(Base.Libc.WindowsRawSocket(0x0000000000000708) active)
julia> c = accept(s)
Base.PipeEndpoint(Base.Libc.WindowsRawSocket(0x00000000000006ec) open, 0 bytes waiting)
julia> c
Base.PipeEndpoint(Base.Libc.WindowsRawSocket(0x00000000000006ec) open, 0 bytes waiting)

Connect from python and close the pipe:

>>> f = open("\\\\.\\pipe\\p123")
>>> f.close()

After that I check whether the pipe is still open. That’s true and I write to it.

julia> isopen(c)

julia> write(c,"Hallo Welt")
ERROR: IOError: write: broken pipe (EPIPE)
Stacktrace:
 [1] uv_error
   @ .\libuv.jl:97 [inlined]
 [2] uv_write_async(s::Base.PipeEndpoint, p::Ptr{UInt8}, n::UInt64)
   @ Base .\stream.jl:1031
 [3] uv_write(s::Base.PipeEndpoint, p::Ptr{UInt8}, n::UInt64)
   @ Base .\stream.jl:981
 [4] unsafe_write(s::Base.PipeEndpoint, p::Ptr{UInt8}, n::UInt64)
   @ Base .\stream.jl:1064
 [5] write(io::Base.PipeEndpoint, s::String)
   @ Base .\strings\io.jl:185
 [6] top-level scope
   @ REPL[13]:1

julia> isopen(c)
true

I get an error as expected but why is the pipe still open?