SMBLibrary
SMBLibrary copied to clipboard
NullReferenceException crashing the application simmilar to #257
Hi, we're using version 1.5.3.5, and from time to time, we get the exception with the stack trace from below. I noticed that every time, just before this happens, we get STATUS_IO_TIMEOUT connection status. Then, on retrying the connection, the app crashes. Setting higher responseTimeoutInMilliseconds to SMB2Client.Connect helps, but doesn't seem like a good permanent solution.
Description: The process was terminated due to an unhandled exception. Exception Info: System.NullReferenceException: Object reference not set to an instance of an object. at Utilities.ByteReader.ReadByte(Byte[] buffer, Int32 offset) at SMBLibrary.NetBios.SessionPacket.GetSessionPacketLength(Byte[] buffer, Int32 offset) at SMBLibrary.NetBios.NBTConnectionReceiveBuffer.HasCompletePacket() at SMBLibrary.Client.SMB2Client.ProcessConnectionBuffer(ConnectionState state) at SMBLibrary.Client.SMB2Client.OnClientSocketReceive(IAsyncResult ar) at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.Tasks.AwaitTaskContinuation.RunCallback(ContextCallback callback, Object state, Task& currentTask) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state) at System.Threading.ThreadPoolWorkQueue.Dispatch() at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()