| |

VerySource

 Forgot password?
 Register
Search
View: 1048|Reply: 9

How to solve the problem that the program does not respond after the ADOConnection connection is abnormally disconnected

[Copy link]

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-1-8 13:40:01
| Show all posts |Read mode
When I used ADOConnection to connect, in order to determine whether the connection was normal, I added a statement to catch the exception. When a connection error occurred, I started a timer and started a new thread in the timer event to retry the connection. But at this time, the program seemed to die, and nothing happened. I would like to ask experts, what is the cause of this, and any good solutions?
Reply

Use magic Report

1

Threads

27

Posts

24.00

Credits

Newbie

Rank: 1

Credits
24.00

 China

Post time: 2020-1-9 10:36:01
| Show all posts
Is a problem
Reply

Use magic Report

0

Threads

17

Posts

16.00

Credits

Newbie

Rank: 1

Credits
16.00

 China

Post time: 2020-1-9 13:00:01
| Show all posts
Start a timer and start a new thread in the timer event to retry the connection
____________________________________________________________________

If you press it like this, once you can't connect, does the program enter an endless loop?
Reply

Use magic Report

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-1-9 16:00:01
| Show all posts
lazying
When I tried a new connection in the timer event, I also added an exception judgment. If an error exception occurs, the process is directly exited. Besides, I am a newly opened thread, should it not affect the operation of the main program?
Reply

Use magic Report

0

Threads

9

Posts

8.00

Credits

Newbie

Rank: 1

Credits
8.00

 China

Post time: 2020-1-9 23:45:01
| Show all posts
Set the TIMEOUT point!
Reply

Use magic Report

0

Threads

6

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

Post time: 2020-1-11 11:45:01
| Show all posts
Open a new thread to connect, do not use TIME.
Reply

Use magic Report

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-2-11 22:30:01
| Show all posts
Can you say specific points?
Reply

Use magic Report

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-4-2 10:15:01
| Show all posts
So what do you do when the server connection is abnormal?
Reply

Use magic Report

0

Threads

14

Posts

9.00

Credits

Newbie

Rank: 1

Credits
9.00

 China

Post time: 2020-4-6 00:00:01
| Show all posts
Your thread time cannot be too short, otherwise there is a connection here, and a new one is started, as long as the thread starts the connection, the thread is blocked
Reply

Use magic Report

1

Threads

5

Posts

6.00

Credits

Newbie

Rank: 1

Credits
6.00

 China

 Author| Post time: 2020-7-11 11:00:01
| Show all posts
Alas, forget it! I don't think I really will!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list