Finished low-level socket API. Added new functions to the public API.