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

Async managing more than 1 client #219

Open
SachukS opened this issue Jul 9, 2024 · 7 comments
Open

Async managing more than 1 client #219

SachukS opened this issue Jul 9, 2024 · 7 comments

Comments

@SachukS
Copy link

SachukS commented Jul 9, 2024

Hi, I'm writing Spring Boot server using tdlight. I want to implement the logic of simultaneous management of telegram clients.
For example, a user logs into my app, then logs into Telegram and uses it. At the same time, another user logs into the application and creates a Telegram client.
Now I have implemented separate threads of execution for each user in a spring boot, and in them I initialize the Telegram clients, but when the second user logs in, the first user receives the second user's Telegram client. In the next logs you can see that there is on tdlib thread for all created clients:
2024-07-05T12:12:20.932+03:00 ERROR 21192 --- [pool-3-thread-1] c.h.TEST.telegram.client.Telegram : Telegram constructor 2024-07-05T12:12:31.287+03:00 ERROR 21192 --- [pool-3-thread-1] c.h.TEST.telegram.client.Telegram : Telegram login 2024-07-05T12:12:31.315+03:00 INFO 21192 --- [pool-3-thread-1] it.tdlight.TelegramClient : Registered new client 1 2024-07-05T12:12:31.352+03:00 INFO 21192 --- [ TDLib thread] c.h.TEST.telegram.client.Telegram : Logged in Telegram 2024-07-05T12:12:31.745+03:00 ERROR 21192 --- [ TDLib thread] c.h.TEST.telegram.client.Telegram : Telegram on new message 2024-07-05T12:12:31.747+03:00 ERROR 21192 --- [ TDLib thread] c.h.TEST.telegram.client.Telegram : Telegram on new message

So, is there ability to implement logic i want, and if yes - how?

@zybot666
Copy link

How to implement different account logins,The user enters the login verification code and how the program receives it?

@SachukS
Copy link
Author

SachukS commented Jul 14, 2024

How to implement different account logins,The user enters the login verification code and how the program receives it?

I'm using QR codes, and i have websockets between my front and back to handle QR codes

@zybot666
Copy link

How to implement different account logins,The user enters the login verification code and how the program receives it?

I'm using QR codes, and i have websockets between my front and back to handle QR codes

fine,do you set the different database catalog ?

@zybot666
Copy link

i wang to user use phonenumber log in tdlib but i don't know how to receive the user's log in code

@SachukS
Copy link
Author

SachukS commented Jul 14, 2024

i wang to user use phonenumber log in tdlib but i don't know how to receive the user's log in code

i have answered in your issue

@SachukS
Copy link
Author

SachukS commented Jul 14, 2024

How to implement different account logins,The user enters the login verification code and how the program receives it?

I'm using QR codes, and i have websockets between my front and back to handle QR codes

fine,do you set the different database catalog ?

not database, but different folder

@zybot666
Copy link

i wang to user use phonenumber log in tdlib but i don't know how to receive the user's log in code

i have answered in your issue

Ok, thank you. Your skills are much higher than mine.

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

No branches or pull requests

2 participants