On 4 août 2011, at 17:25, Igor Stasenko wrote: > 1. why library does not serve as a factory for objects? > > I think it should, so one can write: > > library := MyLibrary new. > socket := library createTcpSocket. > > socket connectTo: (library ipv4Address: 'x.y.z' port: 1000) > > I think it could simplify a lot of things.
We aim at having multiple libraries and the socket choosing the default one, or leting the user choosing a different one. Still we didn't implement this protocol so far, though the bricks are there (see OCNNetworkLibraryProxyFactory) > > 2. what is OCNConversationTcpSocket and what its role? As to me it is > unnecessary. > I'd rather leave only single socket class in kernel. And for others, i > think it would be better to use delegation instead of subclassing. > So you will have: > MyCustomRoleSocket (socket) -> OCNSocket (socketid, library) -> library > TCP conversation socket is the socket that is used for exchanging data (sending / receiving). It's role is different from a TCP server socket which is there for establishing connections. Users of Ocean are not supposed to subclass these classes. If you want to implement a protocol, you need to go through a decorator pattern or a similar solution. > 3. Why OCNSocket keeps track its "state"? I think it would be better > to always ask system about its state, > because you never know for sure.. > Yes. But, so far we don't know how to do it. Can you get the state from the socket plugin? It should be possible in unix, though not trivial. Don't know about Windows. > 4. error handling is below the waterline and needs to be addressed properly :) > See the amount of error codes which connect() could produce. Where are they? > Also, there is a lot of missing things for finer socket controls, like > select(), poll(), fnctl() > setsockopt() etc.. with all flags. > So you have a lot to do :) > Ocean is far from complete. Still have already introduced some exceptions. Still, we don't want to have too many to avoid making the library too complicated. This is why we simplified the socket's life-cycle. > 5. where i can put my code for NativeBoost backend of Ocean? > It seems that you are willing to introduce a new back-end for Ocean. So, you'll have to create a new library. You can take as an example, the plugin-library (OCNSocketPluginLibrary) as an example since it is the most advanced. Still, what you want to do is closer to the currently staled posix-library, based on Alien. > 6. I understand that project is far from being complete, so don't > treat my comments as an arrogant asshole. Just my thoughts, > how it would be better to implement :) > Thanx for the feedback. > I created couple of classes and couple of tests (i could create > socket, connect to remote host), but i stopping now, > since of the above issues. > Ideally, i would like to introduce you to NativeBoost and to see if > you like it and if you can use it without my direct involvement > (because it's already too much on my plate anyways ;) > Cool! We do like NativeBoost. We can pair program a bit together next time we meet. At least in the Esug confo @ Edinburgh :-) Noury http://car.mines-douai.fr/noury -- -19èmes Journées Francophones sur les Systèmes Multi-Agents (JFSMA’11) http://www.univ-valenciennes.fr/congres/jfsma2011/ 17-19 Octobre 2011, Valenciennes, France -5th International Conference on Smalltalk Technologies http://www.fast.org.ar November 3th - 5th, 2011 Universidad Nacional de Quilmes (Argentina)
