本文整理汇总了C#中Connector.Connect方法的典型用法代码示例。如果您正苦于以下问题:C# Connector.Connect方法的具体用法?C# Connector.Connect怎么用?C# Connector.Connect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connector
的用法示例。
在下文中一共展示了Connector.Connect方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
static void Main(string[] args)
{
NetConfig.LatencySimulation = true;
Connector client = new Connector("Sample1.1", false);
Clock fastClock = new Clock(0.02f);
Clock slowClock = new Clock(1.0f);
fastClock.OnFixedUpdate += SendPayload;
slowClock.OnFixedUpdate += SendNotification;
Program.peer = client.Connect("127.0.0.1:42324");
while (true)
{
fastClock.Tick();
slowClock.Tick();
client.Update();
if (Console.KeyAvailable)
{
ConsoleKeyInfo key = Console.ReadKey(true);
switch (key.Key)
{
case ConsoleKey.F1:
client.Stop();
return;
default:
break;
}
}
}
}
示例2: Form2
public Form2()
{
connector = new Connector();
connector.DeviceConnected += new EventHandler(OnDeviceConnected);
connector.Connect("COM31");
InitializeComponent();
}
示例3: connect
public connect(game game)
{
connector = new Connector();
connector.ConnectedEvent += new ConnectedHandler(connector_ConnectedEvent);
connector.Connect("127.0.0.1",59398);
gamee = game;
return;
}
示例4: button_connect_Click
private void button_connect_Click(object sender, RoutedEventArgs e)
{
Connector connector = new Connector();
connector.DeviceConnected += new EventHandler(OnDeviceConnected);
connector.DeviceConnectFail += new EventHandler(OnDeviceFail);
connector.DeviceValidating += new EventHandler(OnDeviceValidating);
connector.DeviceDisconnected += new EventHandler(OnDeviceDisconnected);
connector.Connect("COM31");
Thread.Sleep(450000);
}
示例5: Main
public void Main()
{
Connector connector = new Connector();
connector.DeviceConnected += new EventHandler(OnDeviceConnected);
connector.DeviceConnectFail += new EventHandler(OnDeviceFail);
connector.DeviceValidating += new EventHandler(OnDeviceValidating);
connector.Connect("COM31");
progressBar.ValueChanged += ProgressBar_ValueChanged;
Thread.Sleep(450000);
}
示例6: Connect
public bool Connect()
{
try
{
mConnector = new Connector();
mConnector.OnClientConnected += mConnector_OnClientConnected;
mConnector.Connect(mCenterServer.ip, mCenterServer.port);
return true;
}
catch (Exception)
{
//Console.WriteLine(e.ToString());
return false;
}
}
示例7: PrepareHeadset
void PrepareHeadset(string v_port, TextBox v_text, ProgressBar v_progress)
{
Connector v_connector = new Connector();
v_connector.setBlinkDetectionEnabled(true);
v_connector.DeviceConnected += delegate(object sender2, EventArgs e2)
{
OnDeviceConnected(sender2, e2, v_text, v_progress);
};
// v_connector.DeviceFound += new EventHandler(OnDeviceFound);
v_connector.DeviceConnectFail += new EventHandler(OnDeviceFail);
v_connector.DeviceValidating += new EventHandler(OnDeviceValidating);
v_connector.Connect(v_port);
connectors.Add(v_connector);
//connector2.DeviceConnected += new EventHandler(OnDeviceConnected);
}