tdlight-java icon indicating copy to clipboard operation
tdlight-java copied to clipboard

Async managing more than 1 client

Open SachukS opened this issue 1 year ago • 7 comments

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?

SachukS avatar Jul 09 '24 08:07 SachukS

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

exrtey avatar Jul 14 '24 11:07 exrtey

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

SachukS avatar Jul 14 '24 11:07 SachukS

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 ?

exrtey avatar Jul 14 '24 12:07 exrtey

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

exrtey avatar Jul 14 '24 12:07 exrtey

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 avatar Jul 14 '24 12:07 SachukS

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

SachukS avatar Jul 14 '24 12:07 SachukS

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.

exrtey avatar Jul 14 '24 13:07 exrtey