iptube / SPUDlib

Substrate Protocol for User Datagrams (SPUD) Prototype
BSD 2-Clause "Simplified" License
5 stars 11 forks source link

Socket calls or callbacks? #12

Open palerikm opened 9 years ago

palerikm commented 9 years ago

Should spudlib do a send()? Or rely on the application to provide a callback so it can send the packets on the applications behalf?

A discussion regarding portability and ease of implementing into existing stacks would be good. Maybe supporting both the above scenarios at compile time is a viable option?

hildjj commented 9 years ago

tube_set_socket_functions() does most of what you want at relatively low overhead both at runtime as well as for the programmer. For evidence, see _mock_sendmsg and _mock_recvmsg in tube_test.c. I'm open to doing more; perhaps getting this running on Windows as well as a more... "custom" operating system would give us more specific requirements.