Android is there any way to lock socket with only one device?
===

I am creating a single test application which is using sockets to create a connection between two devices and transfer some data (some sort of messaging app). My question is : Is there any way which I won't let other devices to connect to a device, when he is already connected with another one. For example I have two devices `A` and `B` and they are connected. I don't wanna let device `C` to connect to any of them.

Any ideas how can I achieve this?