public boolean connect(String address, String port) { InetAddress addr; try { addr = InetAddress.getByName(address); } catch (UnknownHostException e1) { e1.printStackTrace(); return false; } // InetAddress addr = InetAddress.getByName("192.168.100.155"); // OSCPortOut oscPortOut = new OSCPortOut(); try { oscPortOut = new OSCPortOut(addr, Integer.valueOf(port)); connected = true; } catch (NumberFormatException | SocketException e1) { e1.printStackTrace(); connected = false; return false; } int i = 1; Object[] args = new Object[1]; return true; }
protected void oscInit() { try { sender = new OSCPortOut(InetAddress.getByName(prj.hostName), prj.portNumber); } catch (Exception ex) { // this is just a demo program, so this is acceptable behavior ex.printStackTrace(); } }
public UdpOscSender(final String hostOut, final int portOut) throws UnknownHostException, SocketException { InetAddress outAddress = null == hostOut || hostOut.equals("localhost") || hostOut.equals("127.0.0.1") ? InetAddress.getLocalHost() : InetAddress.getByName(hostOut); oscPortOut = new OSCPortOut(outAddress, portOut); }
public UdpOscSender(final String hostOut, final int portOut) throws UnknownHostException, SocketException { InetAddress outAddress = null == hostOut || hostOut.equals("localhost") || hostOut.equals("127.0.0.1") ? InetAddress.getLocalHost() : InetAddress.getByName(hostOut); oscPortOut = new OSCPortOut(outAddress, portOut); }
public OscUI(JFrame myParent) { super(); parent = myParent; makeDisplay(); try { oscPort = new OSCPortOut(); } catch (Exception ex) { // this is just a demo program, so this is acceptable behavior ex.printStackTrace(); } }
public void addressChanged() { // the variable OSCPortOut tries to get an instance of OSCPortOut // at the address indicated by the addressWidget try { oscPort = new OSCPortOut(InetAddress.getByName(addressWidget.getText())); // if the oscPort variable fails to be instantiated then sent // the error message } catch (Exception e) { showError("Couldn't set address"); } }