Added non-blocking socket connection functionality