diff --git a/src/Renci.SshNet/Abstractions/SocketAbstraction.cs b/src/Renci.SshNet/Abstractions/SocketAbstraction.cs
index 8ffe3b49..c76a3b04 100644
--- a/src/Renci.SshNet/Abstractions/SocketAbstraction.cs
+++ b/src/Renci.SshNet/Abstractions/SocketAbstraction.cs
@@ -137,6 +137,37 @@ namespace Renci.SshNet.Abstractions
#endif
}
+ ///
+ /// Reads a byte from the specified .
+ ///
+ /// The to read from.
+ /// Specifies the amount of time after which the call will time out.
+ ///
+ /// The byte read, or -1 if the socket was closed.
+ ///
+ /// The read operation timed out.
+ /// The read failed.
+ public static int ReadByte(Socket socket, TimeSpan timeout)
+ {
+ var buffer = new byte[1];
+ if (Read(socket, buffer, 0, 1, timeout) == 0)
+ return -1;
+
+ return buffer[0];
+ }
+
+ ///
+ /// Sends a byte using the specified .
+ ///
+ /// The to write to.
+ /// The value to send.
+ /// The write failed.
+ public static void SendByte(Socket socket, byte value)
+ {
+ var buffer = new[] {value};
+ Send(socket, buffer, 0, 1);
+ }
+
///
/// Receives data from a bound into a receive buffer.
///