I have a server to which clients are connected using TCP connection.

All the clients broadcast to each other using UDP braodcasting.I want to disconnect one of the client from the UDP connections from server.

what can be the possible ways to do this?

please suggest.

Recommended Answers

Uhm, have that client close its socket?

Jump to Post

All 3 Replies

Uhm, have that client close its socket?

UDP is a connectionless protocol. What exactly do you mean by "disconnect the client" when there is no connection?

ps Are you thinking of the connect method in DatagramSocket? - that just simplifies the syntax for sending messages by pre-determining the addresses. From the server end you can ignore that. If you want, for some reason, the client to execute a disconnect() then I think you will have to make the server send a request to the client for the client to "disconnect". However, even if you do that the client can still send datagrams to the server, so if the intention is to prevent further messages from the server you will have to implement some kind of filter on the messages that he server receives.

thank u that was really helpful

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.