I found this in an initial version where I was detecting the modem type using RIL_REQUEST_BASEBAND. I opened and closed the socket in rildev, then let the ril or mtk plugin open the socket again. It wasn't working as the socket had not been properly closed.

I can do another PR, but in the end this is a different commit that will not be mixed up with the rest of the commits in the PR when merged. But will take that into account for new PRs.