[openbeos] Re: Development Model?

  • From: Scott Mansfield <thephantom@xxxxxxx>
  • To: openbeos@xxxxxxxxxxxxx
  • Date: Tue, 13 May 2003 18:45:38 -0700

Hi Waldemar,

On Monday, May 12, 2003, at 10:29 America/Los_Angeles, Waldemar Kornewald wrote:

What are you thinking of when you want to "change aspects of BNetEndpoint"?
As this message was already posted on every possible group I am willing to
talk about it, but I have not understood your problem. ;)

I only posted to the openbeos list because, although I am working on BNetEndpoint, I felt the problem domain was not specific to the networking group. How it wound up on "every possible group" is beyond me.


[-=Snip=-]
Do you mean that InitCheck() only returns B_ERROR instead of the real error?
Please excuse my stupidity. :)

It's not your stupidity. The stupidity is mine alone, curse my flu-addled brain. One should never take Nyquil and then attempt to code or write coherent e-mails. :-)


Anyways, I was struggling with some vagueness in the BeBook. In the BNetEndpoint class the Socket accessor returns member data (an int, from a call to ::socket()). The BeBook states that this accessor "Returns the actual socket used by the BNetEndpoint for data communications." Here are my concerns:
1. What if a particular instance is not initialized, do I return B_NO_INIT (or B_ERROR)? These are not sockets. Yes, I know that BNetEndpoint's consumer is supposed to call "InitCheck()" and act accordingly before doing anything else -- but we're not living in a perfect world; I've seen way too much bad windoze code to know otherwise.
2. We return a non-const 'fd' to an opened socket, free for our caller to trounce upon willy-nilly. Our caller can even close( socket ) on us, leaving whatever instance of BNetEndpoint 'socket' came from in an indeterminate state.


Thanks for your time.

Cheers,
Scott


Other related posts: