title: Processing: open UDP socket for reading?
body: <p>Here's an example of opening and reading data from a TCP socket.  Is there a way to create a UDP socket as well?</p>
  
  
  
  <pre class="lang-java prettyprint-override"><code>void setup() {
      c = new Client(this, "127.0.0.1", 12345); // Replace with your server's IP and port
  }
  
  void draw() {
      if (c.available() &gt; 0) {
          input = c.readString();
  </code></pre>
  
  <blockquote>
    <p><a href="http://www.processing.org/learning/libraries/sharedcanvasclient.html" rel="nofollow noreferrer">http://www.processing.org/learning/libraries/sharedcanvasclient.html</a></p>
  </blockquote>