SimpleSockets icon indicating copy to clipboard operation
SimpleSockets copied to clipboard

Adding a few more basic commands to the server

Open Antwns opened this issue 3 years ago • 2 comments

Is your feature request related to a problem? Please describe. Yes. My project is based around the restart function of the server, aka after the .StartListening(), it would be great to have a .StopListening() method. (Would be great if this feature could also be implemented on the client too)

Describe the solution you'd like Implementing a .StopListening() function and a .StopClient() function.

Additional content It would also be great if the server could "kick" a client by disconnecting it, making the disconnect happen on the client side is less secure, would also help when the server is doing the .StopListening() function to "kick" all connected clients.

Thanks for reading 😄

Antwns avatar Nov 12 '20 14:11 Antwns

Some remarks:

  • The server can 'Kick' a client by using the Close(clientId) method.
  • The client has a function called 'Close()', this kills the client and raises the 'Disconnected' event.
  • The server can be disposed but does not raise any event.

If I understand correctly you'd like to pause the server/client by using 'StopListening()' and resume listening at a later point in time by calling 'StartListening()' again ?

Cloet avatar Nov 24 '20 18:11 Cloet

Exactly! 😄

Antwns avatar Nov 24 '20 18:11 Antwns