示例#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);
        }
示例#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);
        }
示例#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);
        }
示例#4
0
文件: GdbStub.cs 项目: emul8/emul8
        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);
        }
示例#5
0
 public SocketIOSource(int port)
 {
     server = new SocketServerProvider();
     server.Start(port);
 }
示例#6
0
 public SocketIOSource(int port)
 {
     server = new SocketServerProvider();
     server.Start(port);
 }