[ovs-dev] [PATCH 1/3] Windows: Local named pipe implementation

Alin Serdean aserdean at cloudbasesolutions.com
Tue Jul 12 20:15:09 UTC 2016


Thanks for the review!

> -----Mesaj original-----
> De la: Paul Boca
> Trimis: Tuesday, July 12, 2016 10:29 PM
> Către: Alin Serdean <aserdean at cloudbasesolutions.com>;
> dev at openvswitch.org
> Subiect: RE: [PATCH 1/3] Windows: Local named pipe implementation
> 
> Hi Alin!
> 
> As discussed offline, please see my comments inline.
> 
> Thanks,
> Paul
> 
> > +        WaitNamedPipe(connect_path, NMPWAIT_USE_DEFAULT_WAIT);
> [Paul Boca] Maybe we could use only WaitNamedPipe on open, in order to
> check if the pipe exists or not, without the 3 retries and move the CreateFile
> into connect function. This way we would mimic the behaviour of the sockets
> implementation on this without the need of the retries.
> If it doesn't just return an error otherwise return success.
[Alin Gabriel Serdean: ] I was thinking of the do a createfile if the status is ERROR_PIPE_BUSY I can set a flag to the and do the create in the connect again and drop the wait all togheter.
> 
> > +/* Passive named pipe close */
> > +static void
> > +pwindows_close(struct pstream *pstream) {
> > +    struct pwindows_pstream *pwin = pwindows_pstream_cast(pstream);
> > +    DisconnectNamedPipe(pwin->fd);
> > +    CloseHandle(pwin->fd);
> [Paul Boca] Also you could call CloseHandle on write.hEvent, read.hEvent and
> connect.hEvent in order to avoid handle leaks.
[Alin Gabriel Serdean: ] Forgot about them I'll to both close functions.
> 
> > +    maybe_unlink_and_free(pwin->unlink_path);
> > +    free(pwin->pipe_path);
> > +    free(pwin);
> > +}
> > +



More information about the dev mailing list