Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions src/Renci.SshNet/Abstractions/SocketAbstraction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,40 +88,6 @@ private static void ConnectCore(Socket socket, EndPoint remoteEndpoint, TimeSpan
args.Dispose();
}

public static void ClearReadBuffer(Socket socket)
{
var timeout = TimeSpan.FromMilliseconds(500);
var buffer = new byte[256];
int bytesReceived;

do
{
bytesReceived = ReadPartial(socket, buffer, 0, buffer.Length, timeout);
}
while (bytesReceived > 0);
}

public static int ReadPartial(Socket socket, byte[] buffer, int offset, int size, TimeSpan timeout)
{
socket.ReceiveTimeout = timeout.AsTimeout();

try
{
return socket.Receive(buffer, offset, size, SocketFlags.None);
}
catch (SocketException ex)
{
if (ex.SocketErrorCode == SocketError.TimedOut)
{
throw new SshOperationTimeoutException(string.Format(CultureInfo.InvariantCulture,
"Socket read operation has timed out after {0:F0} milliseconds.",
timeout.TotalMilliseconds));
}

throw;
}
}

public static void ReadContinuous(Socket socket, byte[] buffer, int offset, int size, Action<byte[], int, int> processReceivedBytesAction)
{
// do not time-out receive
Expand Down
2 changes: 0 additions & 2 deletions src/Renci.SshNet/Channels/ChannelDirectTcpip.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ protected override void OnOpenConfirmation(uint remoteChannelNumber, uint initia

protected override void OnOpenFailure(uint reasonCode, string description, string language)
{
base.OnOpenFailure(reasonCode, description, language);

_ = _channelOpen.Set();
}

Expand Down
17 changes: 1 addition & 16 deletions src/Renci.SshNet/Channels/ClientChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@ protected ClientChannel(ISession session, uint localChannelNumber, uint localWin
session.ChannelOpenFailureReceived += OnChannelOpenFailure;
}

/// <summary>
/// Occurs when <see cref="ChannelOpenConfirmationMessage"/> is received.
/// </summary>
public event EventHandler<ChannelOpenConfirmedEventArgs> OpenConfirmed;

/// <summary>
/// Occurs when <see cref="ChannelOpenFailureMessage"/> is received.
/// </summary>
public event EventHandler<ChannelOpenFailedEventArgs> OpenFailed;

/// <summary>
/// Called when channel is opened by the server.
/// </summary>
Expand All @@ -43,8 +33,6 @@ protected virtual void OnOpenConfirmation(uint remoteChannelNumber, uint initial

// Channel is consider to be open when confirmation message was received
IsOpen = true;

OpenConfirmed?.Invoke(this, new ChannelOpenConfirmedEventArgs(remoteChannelNumber, initialWindowSize, maximumPacketSize));
}

/// <summary>
Expand All @@ -65,10 +53,7 @@ protected void SendMessage(ChannelOpenMessage message)
/// <param name="reasonCode">The reason code.</param>
/// <param name="description">The description.</param>
/// <param name="language">The language.</param>
protected virtual void OnOpenFailure(uint reasonCode, string description, string language)
{
OpenFailed?.Invoke(this, new ChannelOpenFailedEventArgs(LocalChannelNumber, reasonCode, description, language));
}
protected abstract void OnOpenFailure(uint reasonCode, string description, string language);

private void OnChannelOpenConfirmation(object sender, MessageEventArgs<ChannelOpenConfirmationMessage> e)
{
Expand Down
37 changes: 0 additions & 37 deletions src/Renci.SshNet/Common/ChannelOpenConfirmedEventArgs.cs

This file was deleted.

38 changes: 0 additions & 38 deletions src/Renci.SshNet/Common/ChannelOpenFailedEventArgs.cs

This file was deleted.

104 changes: 0 additions & 104 deletions src/Renci.SshNet/Messages/Authentication/RequestMessageHost.cs

This file was deleted.

1 change: 0 additions & 1 deletion src/Renci.SshNet/Messages/Transport/DebugMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ protected override void SaveData()

internal override void Process(Session session)
{
session.OnDebugReceived(this);
}
}
}
1 change: 0 additions & 1 deletion src/Renci.SshNet/Messages/Transport/IgnoreMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ protected override void SaveData()

internal override void Process(Session session)
{
session.OnIgnoreReceived(this);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected override void SaveData()

internal override void Process(Session session)
{
session.OnServiceAcceptReceived(this);
session.OnServiceAcceptReceived();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ protected override void SaveData()

internal override void Process(Session session)
{
session.OnServiceRequestReceived(this);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ protected override void SaveData()

internal override void Process(Session session)
{
session.OnUnimplementedReceived(this);
}
}
}
Loading