r6150: fixed a few socket_wrapper bugs.