Overview
Features
Download
Documentation
Community
Add-Ons & Services

DialogSocket real "available"

Discussion of ideas for features and new projects based on POCO.

DialogSocket real "available"

Postby delphi13 » 09 Feb 2012, 02:29

Howdy,

This might be considered a bug or a "feature" depending on how you look at it, but the "available()" call in a DialogSocket is effectively useless. "available()" doesn't know about DialogSockets' secondary buffer, so it's possible some data is sitting in the secondary buffer but nothing is available at the socket level. This would return false for data available when there is some in the secondary buffer. "available()" should check both places in a DialogSocket.

I reported a similar issue some time ago with receiveBytes() that lead to the creation of receiveRawBytes(). I'd guess you need some type of "availableRaw()" call if wish to solve it in a similar manner.

Out of curiosity, what's the reasoning for creating receiveRawBytes() instead just overriding receiveBytes()? Both receiveBytes() and available() have zero value in a DialogSocket and their use can cause very inconsistent problems. In my opinion, they should throw an exception at minimum just to prevent their use. If there is some limitation in overriding methods such as this in C++, I apologize. I'm still more use to Delphi's classes where this is common place.

Thanks for your time.
delphi13
 
Posts: 6
Joined: 12 Jul 2010, 04:12

Re: DialogSocket real "available"

Postby alex » 16 May 2012, 05:02

I just glanced over it but you may have a point there. Modify code, run/extend tests, submit a patch and we'll look into it for the next release.
alex
 
Posts: 1146
Joined: 11 Jul 2006, 16:27
Location: United_States


Return to Wishlist

Who is online

Users browsing this forum: No registered users and 1 guest

cron