繁体   English   中英

C#线程未调用方法

[英]C# Thread is not calling the method

我正在做客户端-服务器排序之类的东西,我对此没有任何问题。 但是昨天服务器停止执行线程,这意味着由于某种原因它没有调用该方法。

您可以在下面看到我的代码,这是输出:

可能是什么问题呢?

12/18/2016 11:22:30 AM [Console] The local End point is: 0.0.0.0:28017
12/18/2016 11:22:30 AM [Console] Waiting for a connection.....
12/18/2016 11:22:30 AM [Console] Thread Started! True System.Threading.Thread Lowest True

码:

ServerLogger.Log("The local End point is: " + myList.LocalEndpoint);
ServerLogger.Log("Waiting for a connection.....");
Thread t = new Thread(ThreadVoid);
t.Priority = ThreadPriority.Highest; // I added this because I thought It might help.
t.Start();
ServerLogger.Log("Thread Started! " + t.IsAlive + " " + t + " " + t.Priority + " " + Run);



internal static void ThreadVoid()
{
    ServerLogger.Log("Waiting for connection... (Thread) " + Run);
    while (Run)
    {

不得不进行挖掘,线程内部的try catch没有起作用,但是在线程外部却起作用了。

2016/12/18下午4:18:07 [控制台]错误System.IO.FileNotFoundException:无法加载文件或程序集'System.Drawing,

解决了。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM