File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -41,18 +41,18 @@ with NPopen('r+') as pipe: # bidirectional (duplex) binary pipe
4141 stream = pipe.wait()
4242
4343 # 4. Perform read/write operation with stream (or pipe.stream) as a file-like object
44- b = stream.read(64 )
45- b = pipe.stream.read(64 ) # alternate
44+ b = stream.read(64 ) # read 64 bytes from the client
45+ b = pipe.stream.read(64 ) # same call but using the stream property
4646
4747 in_bytes = bytearray (128 )
48- nread = stream.readinto(in_bytes)
48+ nread = stream.readinto(in_bytes) # read 128 bytes of data from client and place them in in_bytes
4949
50- b_rest = stream.readall()
50+ b_rest = stream.readall() # read all bytes sent by the client, block till client closes the pipe
5151
52- stream.write(out_bytes)
52+ stream.write(out_bytes) # send bytes in out_bytes to the client
5353
5454# 5. the stream is automatically closed and the pipe object is destroyed
55- # when comes out of the contenxt
55+ # when comes out of the context
5656```
5757
5858## API Reference
You can’t perform that action at this time.
0 commit comments