Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to 'Correctly' Close a Connection #109

Open
Mr-KultiVator opened this issue Nov 26, 2023 · 3 comments
Open

How to 'Correctly' Close a Connection #109

Mr-KultiVator opened this issue Nov 26, 2023 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@Mr-KultiVator
Copy link

Congratulations on a genuinely useful library for Delphi - and one with exciting cross-platform potential too!

I've been experimenting with the library and I'm enjoying using it.

One small issue I've had is that I've not discovered in the source code or the online demos the correct way to close/terminate a connection once it's established. (I have an application in mind where multiple connections/disconnections are often required through the course of a single execution of the application.

Many thanks for your work on this library and the video tutorials and Embarcadero event you presented at.

@DeveloppeurPascal
Copy link
Owner

Hi

Thanks for your comment. ;)

To disconnect just destroy (Free or FreeAndNil) your client instance. The socket should close locally and inform the server.

I have something to check/test and fix about disconnecting with TCP connections on the server side (for Mac, but will check the others). Current library should work as it for most little projects but if you have a lot of clients on the same server it could freeze it if you have network problems. I planned to work on this part in December or January.

For game usage or massive users I'll add an UDP version of the library and will try to make it as transparent as choosing UDP/TCP on the connexion.

We can talk about your project in private if you need something not implemented and don't want to share it publicly.

Did you used the generator to use the library or use it manually ?

@DeveloppeurPascal DeveloppeurPascal added the question Further information is requested label Nov 26, 2023
@DeveloppeurPascal DeveloppeurPascal self-assigned this Apr 22, 2024
@DeveloppeurPascal
Copy link
Owner

Hi. I've done some changes to fix anomalies on closing the server or a clients. Please check if it's ok for your use and tell me if anything need to be changed.

@Mr-KultiVator
Copy link
Author

Thanks for sharing this update - I'll take a look when I'm next working in Delphi.

I hadn't spotted your previous question - I was initially just testing the basics of your library, as I've had some problems with Indy (on Android clients) and wanted to explore other options for a hobby project of mine.

If I can get the basics working reliably, I'd then be likely to progress to using your generator approach to build out the various kinds of messages & handlers, as that looks to eliminate writing lots of dull 'boiler-plate' code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants