Explorer ethernet

Technical discussions related to any XMOS development kit or reference design. Eg XK-1A, sliceKIT, etc.
Roblof
Junior Member
Posts: 4
Joined: Sun Nov 06, 2016 11:12 am

Explorer ethernet

Postby Roblof » Sun Nov 06, 2016 11:39 am

Hello everyone!

I'm quite new to this development platform and I am currently in the process of digesting it.

I'm trying to make an simple app that speaks udp. I have had no issue writing this app running in a single thread other than performance/blocking issues that I want to remedy by splitting the app onto two cores due to the asyncronous nature of the x32 - One receive core and one send core.

My app should open an udp connection to a 3'rd party hardware (x32) and the x32 will respond to requests on the same port that was used to send the request from the Explorer. Due to this I can't setup a separate listener on some fixed port.

The problem I'm having is understanding how the recv-core should bind to the socket opened in the send-core.

Also, can I have two xtcp_event() selects - one in each core - for the same connection or would the first responder effectively disable the other one?

Btw, is there a way to disable the info/debug(?) output from xtcp when using dhcp/auto-discovery on the console?
louis
Member
Posts: 9
Joined: Thu Sep 08, 2016 11:27 am

Postby louis » Wed Nov 09, 2016 5:18 pm

Hi there,

Can you please clarify what an x32 is?
the x32 will respond to requests on the same port that was used to send the request from the Explorer.
If I'm understanding you correctly, the easiest solution is to xtcp_connect() from your send core and xtcp_listen() from your receive core with the same port number. This is because the idea of (Berkeley) Sockets don't correspond to xTCP very well.

Please let me know if I've misinterpreted that part of your question.

You shouldn't have a problem with running two xtcp_events(), as the input from the port will only go to the port that is listening (your receive core).

Please let me know which version of xTCP you are using so I can track down that debug information!

Cheers,
Louis
Roblof
Junior Member
Posts: 4
Joined: Sun Nov 06, 2016 11:12 am

Postby Roblof » Fri Nov 11, 2016 12:43 am

Hi louis!

The x32 is a behringer digital audio mixer that can be controlled by osc-messages over udp on port 10023.

You are correct in your assessment about using xtcp_connect in the sending core. When using xtcp_connect to remote host on port 10023 it will pick a random local port to send from. My issue is that I am unable to understand how to bind/listen to that random port, since I won't terminate the connection, in the receiving thread.

Currently my code runs well on a single core, it is the task of splitting it to two cores that escapes me...

The xtcp-events seem to share some common events and since both are bound to the same xtcp_connect I'm uncertain if some events become void since one thread already has handled e.g. xcp_ifdown.

I'm using the very latest xtcp that was downloaded automatically within the editor. I'm unable to verify the correct version number at the moment.

Who is online

Users browsing this forum: No registered users and 2 guests