Changed SLSocket to have functions as members rather than global bindings.