sync or not sync (overlapped)

  • Miguel Angel Mulero Martinez

    Hi, I want to read responses in a sync way.

    How can I do it with your library? In your tests I have seen a Thread.sleep(), so I'm not sure if it is possible.


    • Yuri Astrakhan

      Yuri Astrakhan - 2005-02-23

      It depends on how you want to get your data - as string or as binary.

      You can use ReadLine() to get a complete line of text (make sure you set NewLine parameter to the string end (or you can use ReadTo() - same thing.

      Alternativelly, there is ForceRead() that reads specified number of bytes (or timeout).

    • Miguel Angel Mulero Martinez

      I'm using Read(byte[]) to read the data. Do It works in sync way? I've tried to use ReadTimeout to define de timeout but it is not implemented yet.

      Perhaps I've missed something...

      Thanks for your work! The library is great.

    • Yuri Astrakhan

      Yuri Astrakhan - 2005-03-07

      Read(byte[]) behaves just like Stream.Read does - it blocks if there is no data available, or returns immideatelly if there is anything available in the buffer.

      I have timeouts implemented on my machine, but haven't published them yet. Will do that in a few days.

      I've added Wiki to the project home page, with samples and some more info. Feel free to help out :)


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks