If your code is a library that will be used by other people, using interfaces allows them to provide their own part for any socket even if your library only has one implementation.
It is often used by test code, for example, that wants to use a fake version of something the library provides.
It is often used by test code, for example, that wants to use a fake version of something the library provides.