Beispiel #1
0
        public RemoteDebuggerService(RemoteDebuggerOptions options)
        {
            m_Options = options;

            if (options.HttpPort.HasValue)
            {
                Utf8TcpServerOptions httpopts = options.NetworkOptions & (~Network.Utf8TcpServerOptions.SingleClientOnly);
                m_HttpServer = new DebugWebHost(options.HttpPort.Value, httpopts);

                if (options.SingleScriptMode)
                {
                    m_HttpServer.RegisterResource("/", HttpResource.CreateText(HttpResourceType.Html,
                                                                               string.Format("<html><body><iframe height='100%' width='100%' src='Debugger?port={0}'>Please follow <a href='{0}'>link</a>.</iframe></body></html>", options.RpcPortBase)));
                }
                else
                {
                    m_JumpPage = m_HttpServer.GetJumpPageText();

                    m_HttpServer.RegisterResource("/", HttpResource.CreateCallback(GetJumpPageData));
                }

                m_HttpServer.Start();
            }

            m_RpcPortMax = options.RpcPortBase;
        }
Beispiel #2
0
		public Utf8TcpServer(int port, int bufferSize, char packetSeparator, Utf8TcpServerOptions options)
        {
			m_IPAddress = ((options & Utf8TcpServerOptions.LocalHostOnly) != 0) ? IPAddress.Loopback : IPAddress.Any;
            m_PortNumber = port;
			m_Logger = s => System.Diagnostics.Debug.WriteLine(s);
			PacketSeparator = packetSeparator;
			BufferSize = bufferSize;
			Options = options;
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="Utf8TcpServer"/> class.
 /// </summary>
 /// <param name="port">The port to listen to.</param>
 /// <param name="bufferSize">Size of the buffer. Messages longer than this cause problems.</param>
 /// <param name="packetSeparator">The packet separator. Must be a single byte character in UTF-8</param>
 /// <param name="options">The options.</param>
 public Utf8TcpServer(int port, int bufferSize, char packetSeparator, Utf8TcpServerOptions options)
 {
     m_IPAddress     = ((options & Utf8TcpServerOptions.LocalHostOnly) != 0) ? IPAddress.Loopback : IPAddress.Any;
     m_PortNumber    = port;
     m_Logger        = s => System.Diagnostics.Debug.WriteLine(s);
     PacketSeparator = packetSeparator;
     BufferSize      = bufferSize;
     Options         = options;
 }
Beispiel #4
0
		public DebugServer(string appName, Script script, int port, Utf8TcpServerOptions options, bool freeRunAfterAttach)
		{
			m_AppName = appName;

			m_Server = new Utf8TcpServer(port, 1 << 20, '\0', options);
			m_Server.Start();
			m_Server.DataReceived += m_Server_DataReceived;
			m_Script = script;
			m_FreeRunAfterAttach = freeRunAfterAttach;
		}
Beispiel #5
0
        public DebugServer(string appName, Script script, int port, Utf8TcpServerOptions options, bool freeRunAfterAttach)
        {
            m_AppName = appName;

            m_Server = new Utf8TcpServer(port, 1 << 20, '\0', options);
            m_Server.Start();
            m_Server.DataReceived += m_Server_DataReceived;
            m_Script             = script;
            m_FreeRunAfterAttach = freeRunAfterAttach;
        }
        public DebugWebHost(int port, Utf8TcpServerOptions options)
            : base(port, options)
        {
            RegisterEmbeddedResource("Main.html", HttpResourceType.Html, "Debugger");
            RegisterEmbeddedResource("Main.swf", HttpResourceType.Binary);
            RegisterEmbeddedResource("playerProductInstall.swf", HttpResourceType.Binary);
            RegisterEmbeddedResource("swfobject.js", HttpResourceType.PlainText);

            RegisterEmbeddedResource("bootstrap.min.css", HttpResourceType.Css);
            RegisterEmbeddedResource("theme.css", HttpResourceType.Css);
            RegisterEmbeddedResource("moonsharpdbg.png", HttpResourceType.Png);
            RegisterEmbeddedResource("bootstrap.min.js", HttpResourceType.Javascript);
            RegisterEmbeddedResource("jquery.min.js", HttpResourceType.Javascript);
        }
Beispiel #7
0
		public DebugWebHost(int port, Utf8TcpServerOptions options)
			: base(port, options)
		{
			RegisterEmbeddedResource("Main.html", HttpResourceType.Html, "Debugger");
			RegisterEmbeddedResource("Main.swf", HttpResourceType.Binary);
			RegisterEmbeddedResource("playerProductInstall.swf", HttpResourceType.Binary);
			RegisterEmbeddedResource("swfobject.js", HttpResourceType.PlainText);
			
			RegisterEmbeddedResource("bootstrap.min.css", HttpResourceType.Css);
			RegisterEmbeddedResource("theme.css", HttpResourceType.Css);
			RegisterEmbeddedResource("moonsharpdbg.png", HttpResourceType.Png);
			RegisterEmbeddedResource("bootstrap.min.js", HttpResourceType.Javascript);
			RegisterEmbeddedResource("jquery.min.js", HttpResourceType.Javascript);
		}
Beispiel #8
0
 public HttpServer(int port, Utf8TcpServerOptions options)
 {
     m_Server = new Utf8TcpServer(port, 100 << 10, '\n', options);
     m_Server.DataReceived       += OnDataReceivedAny;
     m_Server.ClientDisconnected += OnClientDisconnected;
 }
Beispiel #9
0
		public HttpServer(int port, Utf8TcpServerOptions options)
		{
			m_Server = new Utf8TcpServer(port, 100 << 10, '\n', options);
			m_Server.DataReceived += OnDataReceivedAny;
			m_Server.ClientDisconnected += OnClientDisconnected;
		}