Commit 996b182f authored by Marc Gravell's avatar Marc Gravell

pipeline reading code; completely non-compiling right now

parent 6af1811b
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
<OutputTypeEx>Library</OutputTypeEx> <OutputTypeEx>Library</OutputTypeEx>
<SignAssembly>true</SignAssembly> <SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign> <PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<LangVersion>7.2</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net46' "> <ItemGroup Condition=" '$(TargetFramework)' == 'net45' OR '$(TargetFramework)' == 'net46' ">
......
...@@ -189,17 +189,18 @@ internal static unsafe int GetHashCode(byte[] value) ...@@ -189,17 +189,18 @@ internal static unsafe int GetHashCode(byte[] value)
return acc; return acc;
} }
} }
internal static bool TryParseInt64(byte[] value, int offset, int count, out long result) internal static bool TryParseInt64(byte[] value, int offset, int count, out long result)
=> TryParseInt64(new ReadOnlySpan<byte>(value, offset, count), out result);
internal static bool TryParseInt64(ReadOnlySpan<byte> value, out long result)
{ {
result = 0; result = 0;
if (value == null || count <= 0) return false; if (value.IsEmpty) return false;
checked checked
{ {
int max = offset + count; int max = value.Length;
if (value[offset] == '-') if (value[0] == '-')
{ {
for (int i = offset + 1; i < max; i++) for (int i = 1; i < max; i++)
{ {
var b = value[i]; var b = value[i];
if (b < '0' || b > '9') return false; if (b < '0' || b > '9') return false;
...@@ -209,7 +210,7 @@ internal static bool TryParseInt64(byte[] value, int offset, int count, out long ...@@ -209,7 +210,7 @@ internal static bool TryParseInt64(byte[] value, int offset, int count, out long
} }
else else
{ {
for (int i = offset; i < max; i++) for (int i = 0; i < max; i++)
{ {
var b = value[i]; var b = value[i];
if (b < '0' || b > '9') return false; if (b < '0' || b > '9') return false;
......
...@@ -37,10 +37,10 @@ internal partial interface ISocketCallback ...@@ -37,10 +37,10 @@ internal partial interface ISocketCallback
void OnHeartbeat(); void OnHeartbeat();
/// <summary> ///// <summary>
/// Indicates that data is available on the socket, and that the consumer should read synchronously from the socket while there is data ///// Indicates that data is available on the socket, and that the consumer should read synchronously from the socket while there is data
/// </summary> ///// </summary>
void Read(); //void Read();
/// <summary> /// <summary>
/// Indicates that we cannot know whether data is available, and that the consume should commence reading asynchronously /// Indicates that we cannot know whether data is available, and that the consume should commence reading asynchronously
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment