We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hi friend.I want to create Server Client application with OSC over UDP.can you show me simple examples.oscP5 library only has TCP example.THANKS
Answers
You can take the TCP example and just change the initialization of the client and the server like so:
It looks like you are not allowed to use the same port for sending and receiving though. Maybe someone with a better understanding of network protocols than mine will be able to explain why this works in TCP and not in UDP.
my friend thanks for answer.but i tried it but doesnt works.there is warning
WARNING @ OscNetManager.send please specify a remote address. send(OscPacket theOscPacket) is only supported when there is a host specified in OscProperties.
Hi, by default all OSC communication with oscP5 is odne over UDP. though, you can specify the transport protocol (see oscP5tcp example). The following example will send osc messages to itself using the UDP protocol
thank you for answering.in the server side do i have to use this part?,server side receives datas but it doesnt send datas?
WARNING @ OscNetManager.send please specify a remote address. send(OscPacket theOscPacket) is only supported when there is a host specified in OscProperties.
like the warning message says, there is no remote address specified - since you took it out. you can add
osc.properties().setRemoteAddress("127.0.0.1" , 12000 );
after
osc = new OscP5(this,12000);
to your previous post to set the remote address inside OscProperties, this will then default to the default remote address.
My friend I want my server to send message to all connected clients.with tcp I have did it.server receives message from one client and sends to anathor client and back.it acts like bridge between two clients .on the server side I didnt type my clients ip adresses.when clients connects server gets ip adresses and answers to this ip adresses.but now you says i have to type all my clients ip adresses on the server.I have not oscP5 0.9.9.
the short answer is, yes you do. you can use an NetAddressList to store all remote addresses. when you send an OSC message you can use this list to distribute this message to all remote addresses stored inside this list. There is the oscP5broadcaster example that mimics the behavior of an 'UDP-server'. the oscP5boradcastClient shows you how to connect to the oscP5broadcaster
UDP is a connection-less network protocol as opposed to TCP which requires a client to connect to a server to establish a connection - a handshake. UDP on the other hand just sends out UDP packets to a remote address without even knowing if this remote address exists - UDP is unreliable, there is no guarantee of delivery, but makes it more suitable than TCP for real time applications