Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
0
		private void btnListen_Click(object sender, EventArgs e)
		{
			DisableConnectionControls();
			lblStatus.Text = "INITIALIZING SERVER..";
			// create the server object
			m_Server = new Utf8TcpServer(int.Parse(txtPort.Text), 1000000, '\n', Utf8TcpServerOptions.Default);
			// attach event handlers.. most are just for logging purposes
			m_Server.ClientConnected += m_Server_ClientConnected;
			m_Server.ClientDisconnected += m_Server_ClientDisconnected;
			m_Server.DataReceived += m_Server_DataReceived;
			// start the server
			m_Server.Start();

			LogStatus("{0} connected clients", m_Server.GetConnectedClients());
			btnSend.Click += Server_btnSend_Click;
		}