1

I am creating a single test application which is using sockets to create a connection between two devices and transfer some data (a kind of messaging app).

My question is: Is there any way which I won't let other devices connect to a device, when it 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?

4

1 に答える 1

1

さて、C が接続するために A と B がどのようにリッスンする必要があるかを確認します。つまり、ServerSocket のようなもので、A と B の間の接続が正常に確立されたら、着信接続のリッスンを停止しますか?

接続方法のコードがなければ、これ以上のことはわかりませんが、それはそれを行う方法です。

于 2012-07-31T13:23:36.687 に答える