mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
31 lines
974 B
C#
31 lines
974 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Net;
|
|
using System.Net.Sockets;
|
|
using System.IO;
|
|
using System.Text;
|
|
|
|
namespace Cosmos.Debug.Common.CDebugger
|
|
{
|
|
public class DebugConnectorTCPServer : DebugConnectorStream {
|
|
|
|
public DebugConnectorTCPServer() {
|
|
var xTCPListener = new TcpListener(IPAddress.Loopback, 4444);
|
|
xTCPListener.Start();
|
|
xTCPListener.BeginAcceptTcpClient(new AsyncCallback(DoAcceptTcpClientCallback), xTCPListener);
|
|
}
|
|
|
|
public void DoAcceptTcpClientCallback(IAsyncResult aResult) {
|
|
var xListener = (TcpListener) aResult.AsyncState;
|
|
var xClient = xListener.EndAcceptTcpClient(aResult);
|
|
Console.WriteLine("TcpClient accepted");
|
|
Start(xClient.GetStream());
|
|
}
|
|
|
|
public override void WaitConnect() {
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
}
|
|
}
|