Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

I'm new to this, but I think I made some useful additions/fixes #13

wants to merge 8 commits into


None yet
2 participants

echelon commented Oct 4, 2012

Hi Josh,

I've never made patches to open source code before, so please forgive me if this is in bad form.

I made the following changes:

  • Bugfix for recvfrom -- it didn't allocate memory for the sender address, so it was previously inaccessible.
  • Addition of bind_socket2() -- you'll probably want to rename / change this, but I couldn't find a way to start a UDP socket in the existing API. This required a change to getaddrinfo() and the addition of a new constant. (See the commit log comments.)
  • Minor stuff -- Readme -> markdown, ignore vim backup files in .gitignore

It might be interesting to add a socket() function that closely emulates the original POSIX function call signature. This could replace my bind_socket2() hack.

Anyway, thanks for reading,


echelon added some commits Oct 4, 2012

bind_socket2() allows protocol hinting (TCP/UDP)
Unless I'm missing something, I was unable to get bind_socket() to
open up UDP (SOCK_DGRAM) sockets. bind_socket2() allows specification
of the desired protocol.

Also made the constants public.

Note: this is probably a bad name. I just copied the code and hacked
this feature in to fit my use case. I'm not yet familiar with all of
Rust's features (traits, polymorphism), so there's probably a better
way to do this.

jdm commented Oct 4, 2012

Thanks! You/we can go ahead and make any changes to bind_socket that are necessary to achieve parity with bind_socket2; there doesn't look to be a good reason to support the existing one and its limitations.


jdm commented Jan 11, 2016

Sorry, I missed these changes and then several years went by and this repository hasn't been maintained for a long, long time.

@jdm jdm closed this Jan 11, 2016

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