# Udp, hypermedia.net probleme to send some byte

**URL:** <https://discourse.processing.org/t/udp-hypermedia-net-probleme-to-send-some-byte/29344>\
**Category:** Libraries\
**Created:** [April 13, 2021, 4:50pm UTC](https://discourse.processing.org/t/udp-hypermedia-net-probleme-to-send-some-byte/29344 "2021-04-13T16:50:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LOUIS1](https://avatars.discourse-cdn.com/v4/letter/l/e9a140/32.png) [@LOUIS1](https://discourse.processing.org/u/LOUIS1)\
**Post date:** [April 13, 2021, 4:50pm UTC](https://discourse.processing.org/t/udp-hypermedia-net-probleme-to-send-some-byte/29344/1 "2021-04-13T16:50:46Z")

</div>

Hello, i have a problem using the [hypermedia.net](http://hypermedia.net) library, i can’t send bytes, when i try i get error message: “The function” send () "expects parameters like: “send (String, String, int)” ".  
While normally it is possible to send some.  
I specify that I start on processing.  
If anyone has an answer.

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [April 13, 2021, 6:14pm UTC](https://discourse.processing.org/t/udp-hypermedia-net-probleme-to-send-some-byte/29344/2 "2021-04-13T18:14:53Z")

</div>

Hello,

Take a look at the UDP examples.  
I created two sketches to talk to each other on the localhost.

I modified this to send the ASCII table as a byte array:

```auto
/** 
 * on key pressed event:
 * send the current key value over the network
 */
void keyPressed() 
  {
  //String message = "";	// the message to send
  
  byte [] data = new byte [256];
  
  for (int i = 0; i< 256; i++)
    {
    data[i] = byte(i);  
    }
    
  String message = new String(data);    
    
  String ip = "192.168.1.100";	// the remote IP address
  int port = 9000; // the destination port
  
  // formats the message for Pd
  message = message+";\n";
  // send the message
  udp.send( message, ip, port );  
  }

```

And voila!

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/2/2e6576b26f8c73e4792225d23a37cca6f40711ff.png)

I also printed the received message size and it is 256 as expected.

See also an example (complicated or simple depending on user experience):

> [@OpenTrack UDP Data Tracking](https://discourse.processing.org/t/opentrack-udp-data-tracking/29115):
>
> Hello folks, I was inspired by this topic by @jetjaguar: [Convert UDP packet to floats?](https://discourse.processing.org/t/convert-udp-packet-to-floats/27843) And this gallery post: [Live Face Tracking (sans OpenCV)](https://discourse.processing.org/t/live-face-tracking-sans-opencv/28010) And was working on receiving the UDP data without the java.nio.ByteBuffer and java.nio.ByteOrder library at the time just [for the heck of it](https://dictionary.cambridge.org/dictionary/english/for-the-heck-of-it) and to work my brain a bit. I do not have a face tracker so used the “Test tracker” input of the [OpenTrack](https://github.com/opentrack/opentrack/releases) software. 
> 
> > **Code**
> >
> > // OpenTrack to Processing // v1.0.0 // GLV 2021-02-28 //Inspiration: //https://discour…

That is as far as I explored the UDP library. 🙂

I worked with the existing examples at first and did a search after for:  
 ![image](https://canada1.discourse-cdn.com/flex036/uploads/processingfoundation1/original/2X/d/d747492994045d3a9570a9ccbf4534f1cb363152.png)

References:  
_[Convert a byte array to a String in Java | Techie Delight](https://www.techiedelight.com/convert-byte-array-string-java/)_

`:)`
