[java-dev] Re: Re: Re: Netreceive: EOF on socket #...
Sam Salem
sam.salem at gmail.com
Fri Jun 1 03:48:14 MDT 2007
- Next message: [java-dev] Re: Re: Re: Netreceive: EOF on socket #...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
...some considerable time later...
So, I've looked at the com.illposed.osc Java implementation of OSC and needless to say, I can't even get the example to compile - we end up with a lot of compilation errors pointing to UnknownHostExceptions - to be honest I had hoped to not have to deal with java.net.*;!
Current state of progress:
My patch consists of a udpreceive connected to an opensoundcontrol object connected to a print. My bang() method is still:
-----------------
UdpSender test = new UdpSender();
test.setAddress("localhost");
test.setPort(5000);
Atom a[] = new Atom[]{Atom.netAtom("I am tired"), Atom.newAtom("Please work!")};
String s = Atom.toOneString(a);
post(a);
test.send(a);
----------------
Which is giving me:
I am tired Please work!
net.recv.udp: OSC packet size (19) not a multiple of 4 bytes: dropping
As far as I can tell, it seems that the message being sent needs to be converted to the OSC message format, so I tried using the following method from the Java OSC implementation:
----------------
OSCJavaToByteArrayConverter Henry = new OSCJavaToByteArrayConverter();
Henry.write("I am very tired");
Henry.write("Please work!");
Henry.appendNullCharToAlignStream();
//then to convert Henry's protected byte stream to a byte array
byte[] tester = Harry.toByteArray();
Atom a[] = Atom.newAtom(tester);
test.send(a);
----------------
Which gives me the following error:
104 97 104 97 104 97 0 0 112 108 101 97 115 101 32 119 111 114 107 33 0 0 0 0 0 0 0 0
net.recv.udp: OSC packet size (85) not a multiple of 4 bytes: dropping
Any ideas?! I think it may be the conversion from byte[] to atom[], altho it could also be the conversion from byte stream to byte[] as I have no reason to believe that the java osc implementation works.
Ack...
- Next message: [java-dev] Re: Re: Re: Netreceive: EOF on socket #...
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
