how to read some in vibe.d tcpconnection?

Stefan Koch via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Mar 6 02:11:59 PST 2015


On Friday, 6 March 2015 at 10:10:35 UTC, zhmt wrote:
>
>>
>> Take a look at empty and leastSize.
>>
>> https://github.com/rejectedsoftware/vibe.d/blob/master/source/vibe/core/stream.d#L33
>
> @Rikki Cattermole
> Thanks for your reply, but it is not what I want, and I cant 
> implement my goal with them.
>
>
> in boost::asio, It has a method like this :
>
>  basic_stream_socket::read_some (1 of 2 overloads)
>
>  This function is used to read data from the stream socket. The 
> function call will block until one or more bytes of data has 
> been read successfully, or until an error occurs.

There should be a function called DataAvilable.
Simply read the data if this function returns true


More information about the Digitalmars-d-learn mailing list