vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function ConnectionStream.waitForData

Blocks until data becomes available for read.

abstract bool waitForData (
  core.time.Duration timeout = max()
) @safe;

The maximum wait time can be customized with the timeout parameter. If there is already data availabe for read, or if the connection is closed, the function will return immediately without blocking.

Parameters

NameDescription
timeout Optional timeout, the default value of Duration.max waits without a timeout.

Returns

The function will return true if data becomes available before the timeout is reached. If the connection gets closed, or the timeout gets reached, false is returned instead.

Authors

Sönke Ludwig

Copyright

© 2012-2016 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.