Binding Using socket connection

I want to develop a binding which will include controlling a smart socket through a hub. Meaning that I need to have a handler for the socket the hub itself. Can someone help or direct me to an existing binding (OH2) that I can easily understand and use the knowledge to implement my own. Socket or any other good communication means.