[OSC_dev] oscpack to send and receive on same port

Gaspard Bucher gaspard at teti.ch
Mon Mar 30 01:35:06 PDT 2009


Found the solution. Basically, you need to first "bind" (define outgoing
port) before doing "connect" (define target). With oscpack, this can be done
by using the same socket for both received elements and sending answers
back:
socket_ = new UdpListeningReceiveSocket( IpEndpointName(
IpEndpointName::ANY_ADDRESS, port ), this );

... Run ...

void ProcessMessage(...) {
  socket_->Connect(remote_endpoint);
  socket_->Send(reply.Data(), reply.Size();
}

I will reflect this in liboscit by moving OscSend's message mangling into
statics so that OscReceive can use it's own socket to send answers back.

Gaspard

On Mon, Mar 30, 2009 at 8:50 AM, Gaspard Bucher <gaspard at teti.ch> wrote:

> Hi List !
> I'm working on the liboscit library and we talked about the fact that we do
> not need a "/.reply_to" method since we can just send that responses to the
> caller's IP and port.
>
> That's fine except I can't seem to figure out how to define the outbound
> port using oscpack.
>
> Anyone with oscpack knowledge ?
>
> Gaspard
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.create.ucsb.edu/pipermail/osc_dev/attachments/20090330/b9bc3202/attachment.html 


More information about the OSC_dev mailing list