Imports a native TCP socket into NSPR.
In theory, code that uses PR_ImportTCPSocket
may break when NSPR's implementation changes. In practice, this is unlikely to happen because NSPR's implementation has been stable for years and because of NSPR's strong commitment to backward compatibility. Using PR_ImportTCPSocket
is much more convenient than writing an NSPR I/O layer that wraps your native TCP sockets. Of course, it is best if you just use PR_OpenTCPSocket
or PR_NewTCPSocket
. If you are not sure whether PR_ImportTCPSocket
is right for you, please ask in the mozilla.dev.tech.nspr newsgroup.