private void button1_Click(object sender, EventArgs e) { try { address = IPAddress.Parse(txtIpAddress.Text); port = int.Parse(txtPort.Text); if (transmitter != null) { transmitter.Close(); } transmitter = new OSCTransmitter(address.ToString(), port); //if(osc != null) //{ // osc.Close(); // osc.Dispose(); //} //osc = new OscSender(address, port); //osc.Connect(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void InitNetwork() { if (!FAutoIP.Equals(FTargetIP) || FAutoPort != FTargetPort) { FTargetIP = FAutoIP; FTargetPort = FAutoPort; if (FTargetIP != null) { try { if (FOSCTransmitter != null) { FOSCTransmitter.Close(); } FOSCTransmitter = new OSCTransmitter(FTargetIP.ToString(), FTargetPort); FOSCTransmitter.Connect(); FLogger.Log(LogType.Debug, "connected to Kontrolleur on: " + FTargetIP.ToString() + ":" + FTargetPort.ToString()); } catch (Exception e) { FLogger.Log(LogType.Warning, "Kontrolleur: failed to open port " + FTargetPort.ToString()); FLogger.Log(LogType.Warning, "Kontrolleur: " + e.Message); } } } }
void TargetPortIOValueChanged(object sender, System.EventArgs e) { try { if (FOSCTransmitter != null) { FOSCTransmitter.Close(); } FOSCTransmitter = null; FOSCTransmitter = new OSCTransmitter(TargetHostIO.Text, (int)(sender as NumericUpDown).Value); } catch (Exception se) { DebugLog.Items.Add("UDP: " + se.Message); } }
void Disconnect() { if (FConnection != null) { FConnection.Close(); } FConnection = null; }
void Window1_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Escape) { _oscTransmitter.Close(); Close(); } }
void StopOSCTransmitter() { if (FOSCTransmitter != null) { FOSCTransmitter.Close(); FOSCTransmitter = null; } }
/// <summary> /// Disconnect the UDP Transmitter. /// </summary> /// <returns></returns> private void disconnectTransmitter() { // Close any open connections. if (pUDPWriter != null) { pUDPWriter.Close(); } pUDPWriter = null; }
public void disconnect() { if (transmitter != null) { transmitter.Close(); } transmitter = null; connected = false; }
void Close() { if (FRunning) { FRunning = false; FThread.Abort(); FClient.Close(); FClient = null; } }
public void disconnect() { if (pUDPWriter != null) { pUDPWriter.Close(); } pUDPWriter = null; if (OnDisconnect != null) { OnDisconnect(); } }
protected void OnDisable() { if (_transmitter == null) { _transmitter = target as OSCTransmitter; } if (!Application.isPlaying && _transmitter.IsStarted) { _transmitter.Close(); } }
private void InitNetwork() { if (FIP != null) { try { if (FOSCTransmitter != null) { FOSCTransmitter.Close(); } FOSCTransmitter = new OSCTransmitter(FIP.ToString(), FTargetPort[0]); FOSCTransmitter.Connect(); } catch (Exception e) { FLogger.Log(LogType.Warning, "PinServer: failed to open port " + FTargetPort.ToString()); FLogger.Log(LogType.Warning, "PinServer: " + e.Message); } } }
void ThreadedFunction() { try { FClient = new OSCTransmitter(FPinInRemote[0], FPinInPort[0]); FClient.Connect(); FRunning = true; lock (FLockStatus) FStatus = "OK"; } catch (Exception e) { lock (FLockStatus) FStatus = e.Message; if (FClient != null) { FClient.Close(); } FRunning = false; return; } List <OSCPacket> copyList; while (FRunning) { lock (FLockPackets) { copyList = new List <OSCPacket>(FPacketList); FPacketList.Clear(); } foreach (var p in copyList) { FClient.Send(p); } } }
private void OscTransmitterConnect() { try { address = IPAddress.Parse(txtIpAddress.Text); port = int.Parse(txtPort.Text); if (transmitter != null) { transmitter.Close(); } transmitter = new OSCTransmitter(address.ToString(), port); ShowStatusText("Connected: " + address + ":" + port); ToggleConnectView(); } catch (Exception ex) { MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK); } }
/// <summary> /// Closes the connection. /// </summary> public void Close() { connected = false; client.Close(); server.Close(); }