Skip to content
This repository was archived by the owner on Feb 21, 2020. It is now read-only.

Comments

Add udp#6

Open
ty19 wants to merge 4 commits intomasterfrom
add_udp
Open

Add udp#6
ty19 wants to merge 4 commits intomasterfrom
add_udp

Conversation

@ty19
Copy link
Member

@ty19 ty19 commented Jan 27, 2019

Add UDP for sending. Tested with final_mocked and python code in add_udp branch of mk1-1-frontend.

Changed files:

  • listener to add creation/destruction of UDP socket
  • network_worker and main_network_worker to use select instead of network_queue_items for send/recv. recv timing in particular should be improved.
  • circular_buffer to send across UDP in one call to sendto(). Code assumes the size of the data packets does not extend past the end of the buffer more than once.

TODO:
Does nbytes include the size of the header? Size of payload data is currently 16 bytes (i.e. size of header) less than nbytes when received. Not sure if this is expected.

ty19 added 4 commits January 25, 2019 22:10
UDP address is currently INADDR_ANY = 0.0.0.0. Sends "abc"
over UDP.

Old code had network_worker::worker_method() continually
poll the network queue to either send, recv, or queue another
recv. New code uses select, which replaces all recv network queue
items since we just receive when the fd has data. Sending checks
for an open fd first then polls the network queue to see if we
need to send. Now that recv is removed, send queue items *should*
be the only thing we need in the network queue.

Removed some references to poll and acks in networking.

TODO modify circular_buffer to send data in the proper format.
Organizing stuff before I start working on the circular buffer
sending.
Copies header and data into a new char array and sends it
in one go as a large datagram. Not sure if this will affect
memory/speed enough to matter.

Need to clean things up as it was a quick and dirty test. Can
remove write_data now that we have this method.
@berkalpyakici
Copy link
Member

@ty19 does this PR move real-time data transfer over UDP (and merges header and body into a single packet)?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants