2009/10/30 Schwab,Wilhelm K <[email protected]>:
> Hello all,
>
> What would be involved in adding a socket stream instance variable/accessor 
> to Socket?  Is that something you would support?  So far, I created a shared 
> dictionary (cleared on true startup) of sockets to streams, so once created, 
> the stream is associated with the corresponding socket, and accessible from 
> same using #socketStream.  From there, I have #readStream and #writeStream 
> accessors, which return the one stream - Dolphin separates them, and there is 
> no reason to break the news to my code just yet.
>

Err... what kind of stream you would answer for UDP socket, a socket
which inherently doesn't mean to support streaming capabilities?
The only reason why i would need to enforce 1:1 association of
stream-based socket with corresponding stream is to make sure that
nobody constructs multiple streams for using the same socket and in
this way abuses it. But i wouldn't care about that. There are numerous
ways how to shoot in own foot, and given case is very unlikely happen,
unless you doing a really stupid things, like exposing the sockets to
different layers of your application instead of exposing the streams
which they should use.

But from this perspective, wouldn't it be better to simply create a
subclass of Socket, which supports a stream protocol, so you enforcing
the 1:1 rule from very start and there is no way how to create one
socket to many streams association.

> Bill
>
>
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>



-- 
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to