Remove unneeded files and clean up remaining code.

This commit is contained in:
Karl Burtram
2016-07-15 23:22:27 -07:00
parent c78292a680
commit f2bb986f42
53 changed files with 63 additions and 3742 deletions

View File

@@ -1,83 +0,0 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#if false
using System;
using System.IO.Pipes;
using System.Threading.Tasks;
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel
{
public class NamedPipeClientChannel : ChannelBase
{
private string pipeName;
private bool isClientConnected;
private NamedPipeClientStream pipeClient;
public NamedPipeClientChannel(string pipeName)
{
this.pipeName = pipeName;
}
public override async Task WaitForConnection()
{
#if NanoServer
await this.pipeClient.ConnectAsync();
#else
this.IsConnected = false;
while (!this.IsConnected)
{
try
{
// Wait for 500 milliseconds so that we don't tie up the thread
this.pipeClient.Connect(500);
this.IsConnected = this.pipeClient.IsConnected;
}
catch (TimeoutException)
{
// Connect timed out, wait and try again
await Task.Delay(1000);
continue;
}
}
#endif
// If we've reached this point, we're connected
this.IsConnected = true;
}
protected override void Initialize(IMessageSerializer messageSerializer)
{
this.pipeClient =
new NamedPipeClientStream(
".",
this.pipeName,
PipeDirection.InOut,
PipeOptions.Asynchronous);
this.MessageReader =
new MessageReader(
this.pipeClient,
messageSerializer);
this.MessageWriter =
new MessageWriter(
this.pipeClient,
messageSerializer);
}
protected override void Shutdown()
{
if (this.pipeClient != null)
{
this.pipeClient.Dispose();
}
}
}
}
#endif

View File

@@ -1,65 +0,0 @@
//
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
#if false
using System;
using System.IO.Pipes;
using System.Threading.Tasks;
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel
{
public class NamedPipeServerChannel : ChannelBase
{
private string pipeName;
private NamedPipeServerStream pipeServer;
public NamedPipeServerChannel(string pipeName)
{
this.pipeName = pipeName;
}
public override async Task WaitForConnection()
{
#if NanoServer
await this.pipeServer.WaitForConnectionAsync();
#else
await Task.Factory.FromAsync(this.pipeServer.BeginWaitForConnection, this.pipeServer.EndWaitForConnection, null);
#endif
this.IsConnected = true;
}
protected override void Initialize(IMessageSerializer messageSerializer)
{
this.pipeServer =
new NamedPipeServerStream(
pipeName,
PipeDirection.InOut,
1,
PipeTransmissionMode.Byte,
PipeOptions.Asynchronous);
this.MessageReader =
new MessageReader(
this.pipeServer,
messageSerializer);
this.MessageWriter =
new MessageWriter(
this.pipeServer,
messageSerializer);
}
protected override void Shutdown()
{
if (this.pipeServer != null)
{
this.pipeServer.Dispose();
}
}
}
}
#endif

View File

@@ -3,11 +3,9 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Serializers;
using System.Diagnostics;
using System.IO;
using System.Text;
using System;
using System.Threading.Tasks;
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel

View File

@@ -3,10 +3,8 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
//
using Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Serializers;
using System.IO;
using System.Text;
using System;
using System.Threading.Tasks;
namespace Microsoft.SqlTools.EditorServices.Protocol.MessageProtocol.Channel