Flush the write buffer to the pixelflut server
This commit is contained in:
@@ -57,7 +57,7 @@ git clone https://github.com/timvisee/pixelpwnr.git
|
|||||||
cd pixelpwnr
|
cd pixelpwnr
|
||||||
|
|
||||||
# Install pixelpwnr
|
# Install pixelpwnr
|
||||||
cargo install
|
cargo install -f
|
||||||
|
|
||||||
# Start using pixelpwnr
|
# Start using pixelpwnr
|
||||||
pixelpwnr --help
|
pixelpwnr --help
|
||||||
|
|||||||
@@ -86,7 +86,13 @@ impl Client {
|
|||||||
fn write_command(&mut self, cmd: String) -> Result<(), Error> {
|
fn write_command(&mut self, cmd: String) -> Result<(), Error> {
|
||||||
// Write the pixels and a new line
|
// Write the pixels and a new line
|
||||||
self.stream.write(cmd.as_bytes())?;
|
self.stream.write(cmd.as_bytes())?;
|
||||||
self.stream.write("\n".as_bytes())?;
|
self.stream.write("\r\n".as_bytes())?;
|
||||||
|
|
||||||
|
// Flush, make sure to clear the send buffer
|
||||||
|
// TODO: make flushing configurable
|
||||||
|
// TODO: make buffer size configurable
|
||||||
|
self.stream.flush()
|
||||||
|
.expect("failed to flush write buffer to server");
|
||||||
|
|
||||||
// Everything seems to be ok
|
// Everything seems to be ok
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|||||||
Reference in New Issue
Block a user