Ejemplo n.º 1
0
        public ServerSocketTerminal(int port, bool emitConfigBytes = true)
        {
            server = new SocketServerProvider();
            server.DataReceived += CallCharReceived;
            server.ConnectionAccepted += s =>
            {
                if(!emitConfigBytes)
                {
                    return;
                }

                var initBytes = new byte[] { 
                    255, 253, 000, // IAC DO    BINARY
                    255, 251, 001, // IAC WILL  ECHO
                    255, 251, 003, // IAC WILL  SUPPRESS_GO_AHEAD
                    255, 252, 034, // IAC WONT  LINEMODE
                };
                s.Write(initBytes, 0, initBytes.Length);
                try
                {
                    // we expect 9 bytes as a result of sending
                    // config bytes
                    for(int i = 0; i < 9; i++)
                    {
                        s.ReadByte();
                    }
                }
                catch(ObjectDisposedException)
                {
                    // intentionally left blank
                }
            };

            server.Start(port);
        }
Ejemplo n.º 2
0
        public GdbStub(int port, ICpuSupportingGdb cpu, bool autoStartOnConnection)
        {
            this.cpu = cpu;
            Port     = port;

            pcktBuilder = new PacketBuilder();
            commands    = new CommandsManager(cpu);
            TypeManager.Instance.AutoLoadedType += commands.Register;

            terminal = new SocketServerProvider();
            terminal.DataReceived       += OnByteWritten;
            terminal.ConnectionAccepted += delegate
            {
                cpu.Halted       += OnHalted;
                cpu.ExecutionMode = ExecutionMode.SingleStep;
                if (autoStartOnConnection)
                {
                    cpu.Start();
                }
            };
            terminal.ConnectionClosed += delegate
            {
                cpu.Halted       -= OnHalted;
                cpu.ExecutionMode = ExecutionMode.Continuous;
            };
            terminal.Start(port);
            commHandler = new CommunicationHandler(this);
        }
Ejemplo n.º 3
0
        public GdbStub(int port, ICpuSupportingGdb cpu)
        {
            this.cpu = cpu;
            Port     = port;

            pcktBuilder = new PacketBuilder();

            commands = new CommandsManager(cpu);
            TypeManager.Instance.AutoLoadedType += commands.Register;

            cpu.Halted       += OnHalted;
            cpu.ExecutionMode = ExecutionMode.SingleStep;

            terminal = new SocketServerProvider();
            terminal.DataReceived += OnByteWritten;
            terminal.Start(port);
        }
Ejemplo n.º 4
0
        public GdbStub(int port, ICpuSupportingGdb cpu)
        {
            this.cpu = cpu;
            Port = port;

            pcktBuilder = new PacketBuilder();

            commands = new CommandsManager(cpu);
            TypeManager.Instance.AutoLoadedType += commands.Register;

            cpu.Halted += OnHalted;
            cpu.ExecutionMode = ExecutionMode.SingleStep;

            terminal = new SocketServerProvider();
            terminal.DataReceived += OnByteWritten;
            terminal.Start(port);
        }
Ejemplo n.º 5
0
 public SocketIOSource(int port)
 {
     server = new SocketServerProvider();
     server.Start(port);
 }
Ejemplo n.º 6
0
 public SocketIOSource(int port)
 {
     server = new SocketServerProvider();
     server.Start(port);
 }