Skip to content

Sharing a socket for client and server #16

@digitalshow

Description

@digitalshow

I have the following application scheme:
There is a OSC UDP server that has some properties. I connect to it and can subscribe to property changes by sending to "/xremote" periodically. The server will then send me updates on properties to the port I sent the subscription message from. So I need to receive from the same socket as I use for sending.

I use the following workaround:

@client = OSC::Client.new('10.1.2.3', 1234)
@server = OSC::EMServer.new(99999)
socket =  @client.instance_variable_get(:@so)

def @server.run(s)
  EM.error_handler{ |e|
    Thread.main.raise e
  }

  EM.run do
    EM::attach s, OSC::Connection
  end
end

It would be nice to have the possibility without a hack.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions