[ovs-dev] [PATCH] python windows: Allow clients to read from server before disconnect

2017-01-26 Thread Alin Serdean
Wait for clients to read from the pipe before disconnecting the server.

Signed-off-by: Alin Gabriel Serdean 
---
Intended for master and branch-2.7
---
 python/ovs/stream.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/python/ovs/stream.py b/python/ovs/stream.py
index 58c4925..be69534 100644
--- a/python/ovs/stream.py
+++ b/python/ovs/stream.py
@@ -233,6 +233,9 @@ class Stream(object):
 self.socket.close()
 if self.pipe is not None:
 if self._server:
+# Flush the pipe to allow the client to read the pipe
+# before disconnecting.
+win32pipe.FlushFileBuffers(self.pipe)
 win32pipe.DisconnectNamedPipe(self.pipe)
 winutils.close_handle(self.pipe, vlog.warn)
 winutils.close_handle(self._read.hEvent, vlog.warn)
-- 
2.10.2.windows.1
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev


Re: [ovs-dev] [PATCH] python windows: Allow clients to read from server before disconnect

2017-01-27 Thread Guru Shetty
On 26 January 2017 at 11:44, Alin Serdean 
wrote:

> Wait for clients to read from the pipe before disconnecting the server.
>
> Signed-off-by: Alin Gabriel Serdean 
> ---
> Intended for master and branch-2.7
>
Applied.



> ---
>  python/ovs/stream.py | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/python/ovs/stream.py b/python/ovs/stream.py
> index 58c4925..be69534 100644
> --- a/python/ovs/stream.py
> +++ b/python/ovs/stream.py
> @@ -233,6 +233,9 @@ class Stream(object):
>  self.socket.close()
>  if self.pipe is not None:
>  if self._server:
> +# Flush the pipe to allow the client to read the pipe
> +# before disconnecting.
> +win32pipe.FlushFileBuffers(self.pipe)
>  win32pipe.DisconnectNamedPipe(self.pipe)
>  winutils.close_handle(self.pipe, vlog.warn)
>  winutils.close_handle(self._read.hEvent, vlog.warn)
> --
> 2.10.2.windows.1
> ___
> dev mailing list
> d...@openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-dev
>
___
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev