3 Replies Latest reply: Feb 28, 2008 2:00 PM by sneakyimp RSS

    Overriding base class methods

    sneakyimp Community Member
      I would like to write a class that extends XMLSocket. I'd like to call my class RPCSocket. Among other things, I want to add a property which indicates that the socket is 'waiting to connect'. This would mean that the connect() method of XMLSocket has been called but the CONNECT event has not yet been dispatched. I'll therefore need to override the CONNECT and CLOSE methods of XMLSocket in my class, RPCSocket.

      I haven't yet seen any reason why I can't override these methods -- they are neither constant nor static nor final and do not implement an interface method (as far as I can tell) and they are inherited.

      I obviously need to call the original connect() and close() methods of the XMLSocket, however. Is the attached code the proper way to do this? Can anyone see any particular problem with the attached code?