未处理 System.NullReferenceException
Message=未将对象引用设置到对象的实例。
Source=TCPServer
StackTrace:
在 TCPServers.Servers.receiveFunc(Object obj)
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart(Object obj)
InnerException:未处理 System.ArgumentOutOfRangeException
Message=索引超出范围。必须为非负值并小于集合大小。
参数名: index
Source=mscorlib
ParamName=index
StackTrace:
在 System.ThrowHelper.ThrowArgumentOutOfRangeException()
在 System.Collections.Generic.List`1.RemoveAt(Int32 index)
在 System.Collections.Generic.List`1.Remove(T item)
在 TCPServers.Servers.receiveFunc(Object obj)
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart(Object obj)
InnerException:TCPServers这个是我引用的基类,是这个有逻辑的错误吗?
Message=未将对象引用设置到对象的实例。
Source=TCPServer
StackTrace:
在 TCPServers.Servers.receiveFunc(Object obj)
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart(Object obj)
InnerException:未处理 System.ArgumentOutOfRangeException
Message=索引超出范围。必须为非负值并小于集合大小。
参数名: index
Source=mscorlib
ParamName=index
StackTrace:
在 System.ThrowHelper.ThrowArgumentOutOfRangeException()
在 System.Collections.Generic.List`1.RemoveAt(Int32 index)
在 System.Collections.Generic.List`1.Remove(T item)
在 TCPServers.Servers.receiveFunc(Object obj)
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart(Object obj)
InnerException:TCPServers这个是我引用的基类,是这个有逻辑的错误吗?
receiveFunc方法中ThreadStart(Object state)
这个Object为null引起的吧
或可能是你这个Object之前是从列表中获取的,而索引不正确,所以才又索引越界一说
或者是因为开启线程过多而引起的呢?因为我发现这里之前是每发送一次,就开启一条线程,是不是开启过多了?(手误写多了~~~~~~~~之前以为他们写的基类,有个方法是发送连接)