# Server sample

    source ../../oo.tcl

    @import core.*

    @interface EchoServer : Server {
    }

    @implementation EchoServer {
      - handleRequest:fromSocket:address:andPort: {
          aRequest aSocket anAddress aPort
        } {
          puts stderr "got \"$aRequest\" from: $anAddress port: $aPort"
          if [$self isEncrypted] { aRequest encrypt }
          puts $aSocket $aRequest
          flush $aSocket
        }
    }

    [[[EchoServer new] port: 2002] start]