tisdag 3 januari 2012

Changing channel

Picking up my networking work. I created a VMNetChannel which holds all socket/net-related operations and altering VMChannel to only contain file I/O. Looking at where VMChannel is used, I can only find the entries listed in the screenshot.





Hopefully it is only a matter of:
1. Removing all net-related methods in VMChannel
2. Replacing VMChannel with VMNetChannel in net-classes
3. Recompile, ship and release! ;) Well... sort of.



Looking closer at the screenshot reveals that VMChannel is used in the VMChannelOwner interface. This interface makes sure that Channel implementations (i.e. any *ChannelImpl-class) can return a VMChannel... so I'm assuming this would also have to be replicated with a VMNetChannelOwner interface, which consequently must be implemented by any net/socket-related ChannelImpl-classes (i.e. *SocketChannelImpl). This will most likely lead to even more dependencies since each class using these implementations rely on VMChannel methods. Another solution would be to change the VMChannel class to an interface implemented by two new classes, VMFileChannel and VMNetChannel. They would throw exceptions for any un-implemented methods. That way, the classpath would still compile without to much change, but could/would(/should?) fail in runtime. One perk of the second solution would be that changes would only (looking quickly at the search result) be made in the reference-classes (the last three entries in the vm/reference/-drawer), which is good from a maintainability point-of-view. (Any VM-specific stuff should go in the vm-drawer, so any VM can use the non-VM-specific stuff [not in /vm/reference/]. If I were to make changes in other classes, these classes would have to be moved to the vm-drawer and affect more parts of the GNU Classpath.)


Don't know how much time I will have for Jamiga the next few months though... Hopefully some, but probably not much.

3 kommentarer:

  1. What setup do you recommend to be able to build? Can it be done on AROS?

    SvaraRadera
  2. I'd recommend gcc. It should be possible on Aros, yes, but not right out of the box at the moment. The CrossCompile.mk script might need modification, and library headers/proto/fd/pragma/whatnot need to be fixed. I tried to fix it, but I had no working Aros setup, and it wasn't as much fun. ;)

    Apart from library headers and correct compile-arguments, there might be some incompatible code -- but that should be easily fixed with a few "#if OS=AROS"-preprocessor directives. The code is prepared to be multiplatform.

    I think there is some documentation in the wiki at http://jamiga2.googlecode.com for compiling it all.

    SvaraRadera
  3. Jobbar du själv på detta fortfarande?

    SvaraRadera