信号灯超时时间已过期 [英] The semaphore timeout period has expired

查看:959
本文介绍了信号灯超时时间已过期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到这个错误...




信号灯超时时间已过期。


< /块引用>

在这一行...




ThePorts.ActivePort1.Open();




...但我只能从时间得到它的时间。当它发生,它发生了一遍又一遍。然后问题消失,数小时或数天,然后回来。



串行端口与连接的蓝牙USB。



我觉得这家伙是有一个非常类似的问题,但不是在C#



上SerialPort.Open / DeviceIoControl的/ getcommState冻结与usbser.sys



尽我所能估计,我看过他的整个问题,并将得到的意见,得到的答复,但我真的想不出哪一个固定他的问题,或如果C#是他经历了什么显著的不同。为无能的任何帮助。



感谢。这是它的发生的实际代码。

 公共静态无效Open_ActivePortWeWillUse(字符串Drone_StringNameFromUser)
{
的SerialPort TempSerialPort =新的SerialPort(Drone_StringNameFromUser,(INT)SerialPortSpeed);

ThePorts.ActivePort1 = TempSerialPort;

ThePorts.ActivePort1.DataBits = 8;
ThePorts.ActivePort1.Parity = Parity.None;
ThePorts.ActivePort1.StopBits = StopBits.One;

ThePorts.ActivePort1.DataReceived + =新SerialDataReceivedEventHandler(OurBackGroundSerialPortReceiver);

ThePorts.ActivePort1.Open(); //有时错误点击这里
}


解决方案
< 。p>好吧,我现在没有连接信号量超时问题



如果任何阅读曾经遇到同样的事情,我希望这个程序对你的作品;但没有承诺;嘿,这是窗户。



在我的情况下,这是Windows 7的



我有一个小提示从<一个HREF =http://www.ehow.com/how_6813220_restart-usb-hub.html相对=nofollow>上eHow此页面;不知道这可能会帮助任何人或没有。



所以无论如何,这是对我来说。


$ B工作的简单的23步程序$ b

  • 点击开始按钮


  • 选择控制面板


  • 从控制面板,选择设备管理器


  • 从设备管理器,选择通用串行总线控制器


  • 从通用串行总线控制器,点击小横盘整理三角形


  • 我无法预测什么,你会在您的计算机上看到的,但在我的我弄了半天下拉列表


  • 开始调查,以找出哪些这个名单,这些成员之一是罪魁祸首?




    • 在下拉列表中的每个成员,在名称

    • $右击b $ b
    • 一个列表将打开,选择属性。


    • 臆测时间:使用附近出现的窗口顶部的各个选项卡将打开,做一个猜测,如果这是一个与信号量超时窒息你的东西



  • 一旦USB适配器驱动程序你所做的正确的猜测,然后关闭USB根集线器属性窗口(但保持设备管理器窗口中打开)。


  • 从物理disonnect予取予求USB集线器。


  • 拔掉它。


  • 你的鼠标指针返回到该USB根中心在先前确定的列表。


  • 右键单击再次


  • 选择卸载


  • 让Windows做它的事


  • 等待一小会儿


  • 关机了整个计算机,如果你有时间;有人说这是必需的。我想,我把他离不开它了。


  • 将USB集线器回PC上的USB接口


  • 如果列表中的设备管理器闪烁并做了一些闪光的灯泡,这没关系。


  • 将蓝牙连接回USB集线器


  • 让Windows做它的东西多一些。


  • 不到两分钟,我再有一个工作的COM端口,没有信号量超时。




希望工程为别人谁可能是具有类似问题。


I'm getting this error...

The semaphore timeout period has expired.

On this line...

ThePorts.ActivePort1.Open();

...but I only get it from time to time. When it happens, it happens over and over again. Then the problem goes away, for hours or days, then it comes back.

The serial port is a USB with a BlueTooth connected.

I think this guy was having a very similar problem, but not in C#

Freeze on SerialPort.Open / DeviceIoControl / GetcommState with usbser.sys

As best I can estimate, I have read his entire problem, and the resulting comments, and the answer, but I really can't figure out which one fixed his problem, or if C# is significantly different from what he was experiencing.

Thanks for any help for the clueless. This is the actual code where it's happening.

public static void Open_ActivePortWeWillUse(String Drone_StringNameFromUser)
{
    SerialPort TempSerialPort = new SerialPort(Drone_StringNameFromUser, (int) SerialPortSpeed);

    ThePorts.ActivePort1 = TempSerialPort;

    ThePorts.ActivePort1.DataBits = 8;
    ThePorts.ActivePort1.Parity = Parity.None;
    ThePorts.ActivePort1.StopBits = StopBits.One;

    ThePorts.ActivePort1.DataReceived += new SerialDataReceivedEventHandler(OurBackGroundSerialPortReceiver);

    ThePorts.ActivePort1.Open();  // "Sometimes" Error hits here
}

解决方案

Okay, I am now connecting without the semaphore timeout problem.

If anyone reading ever encounters the same thing, I hope that this procedure works for you; but no promises; hey, it's windows.

In my case this was Windows 7

I got a little hint from This page on eHow; not sure if that might help anyone or not.

So anyway, this was the simple twenty three step procedure that worked for me

  • Click on start button

  • Choose Control Panel

  • From Control Panel, choose Device Manger

  • From Device Manager, choose Universal Serial Bus Controllers

  • From Universal Serial Bus Controllers, click the little sideways triangle

  • I cannot predict what you'll see on your computer, but on mine I get a long drop-down list

  • Begin the investigation to figure out which one of these members of this list is the culprit...

    • On each member of the drop-down list, right-click on the name

    • A list will open, choose Properties

    • Guesswork time: using the various tabs near the top of the resulting window which opens, make a guess if this is the USB adapter driver which is choking your stuff with semaphore timeouts

  • Once you have made the proper guess, then close the USB Root Hub Properties window (but leave the Device Manager window open).

  • Physically disonnect anything and everything from that USB hub.

  • Unplug it.

  • Return your mouse pointer to that USB Root Hub in the list which you identified earlier.

  • Right click again

  • Choose Uninstall

  • Let Windows do its thing

  • Wait a little while

  • Power Down the whole computer if you have the time; some say this is required. I think I got away without it.

  • Plug the USB hub back into a USB connector on the PC

  • If the list in the device manager blinks and does a few flash-bulbs, it's okay.

  • Plug the BlueTooth connector back into the USB hub

  • Let windows do its thing some more

  • Within two minutes, I had a working COM port again, no semaphore timeouts.

Hope it works for anyone else who may be having a similar problem.

这篇关于信号灯超时时间已过期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆