コード例 #1
0
 protected override IClientConnectionHost CreateClientConnectionHost(string pipeName)
 {
     var port = int.Parse(pipeName);
     var ipAddress = IPAddress.Parse(DefaultAddress);
     var endPoint = new IPEndPoint(ipAddress, port: port);
     var clientDirectory = AppContext.BaseDirectory;
     var compilerHost = new CoreClrCompilerServerHost(clientDirectory);
     var connectionHost = new TcpClientConnectionHost(compilerHost, endPoint);
     return connectionHost;
 }
コード例 #2
0
 public static void Main(string[] args)
 {
     var ipAddress = IPAddress.Parse("127.0.0.1");
     var endPoint = new IPEndPoint(ipAddress, port: 12000);
     var clientDirectory = AppContext.BaseDirectory;
     var compilerHost = new CoreClrCompilerServerHost(clientDirectory);
     var connectionHost = new TcpClientConnectionHost(compilerHost, endPoint);
     var serverDispatcher = new ServerDispatcher(connectionHost);
     serverDispatcher.ListenAndDispatchConnections(keepAlive: null, cancellationToken: CancellationToken.None);
 }
コード例 #3
0
        public static void Main(string[] args)
        {
            var ipAddress        = IPAddress.Parse("127.0.0.1");
            var endPoint         = new IPEndPoint(ipAddress, port: 12000);
            var clientDirectory  = AppContext.BaseDirectory;
            var compilerHost     = new CoreClrCompilerServerHost(clientDirectory);
            var connectionHost   = new TcpClientConnectionHost(compilerHost, endPoint);
            var serverDispatcher = new ServerDispatcher(connectionHost);

            serverDispatcher.ListenAndDispatchConnections(keepAlive: null, cancellationToken: CancellationToken.None);
        }
コード例 #4
0
        protected override IClientConnectionHost CreateClientConnectionHost(string pipeName)
        {
            var port            = int.Parse(pipeName);
            var ipAddress       = IPAddress.Parse(DefaultAddress);
            var endPoint        = new IPEndPoint(ipAddress, port: port);
            var clientDirectory = AppContext.BaseDirectory;
            var compilerHost    = new CoreClrCompilerServerHost(clientDirectory);
            var connectionHost  = new TcpClientConnectionHost(compilerHost, endPoint);

            return(connectionHost);
        }
コード例 #5
0
        protected override IClientConnectionHost CreateClientConnectionHost(string pipeName)
        {
            // VBCSCompiler is installed in the same directory as csc.exe and vbc.exe which is also the
            // location of the response files.
            var clientDirectory = AppDomain.CurrentDomain.BaseDirectory;

#if NET46
            var sdkDirectory       = RuntimeEnvironment.GetRuntimeDirectory();
            var compilerServerHost = new DesktopCompilerServerHost(clientDirectory, sdkDirectory);
#else
            var sdkDirectory       = (string)null;
            var compilerServerHost = new CoreClrCompilerServerHost(clientDirectory, sdkDirectory);
#endif
            return(new NamedPipeClientConnectionHost(compilerServerHost, pipeName));
        }