Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve the self-starting pit of websocket in windows

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

How to solve the websocket self-starting pit in windows, I believe that many inexperienced people are at a loss about this. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

Huh? Why did my program fail to run? Websocket has been unable to connect after restarting the computer. What the heck is this?

The thing is, there is a Mini Program (a program with a very small project) running on the windows server, saying that it is not a server, because it is not standby 24 hours a day, so let's just call it a server. We made a websocket service, put it in the windows self-boot program, and then started the websocket service every time, and then the web side connected to websocket for two-way communication to complete the response operation!

But the problem is that this server needs to be shut down and then started every day, because my websocket service is in self-startup. Coincidentally, I did not adjust the loading order, but caused the following problems, the following is the error message:

Reported an error message that failed to bind ip, but the error message should be obvious and should be found soon, but there is also a hole, that is, the above is the error message reported by wamp, coincidentally, phpstudy is also loaded, but it does not display the error message normally, this is very embarrassing!

This gives you the illusion that there is no problem with the program visually (of course, it is still a bit of a dish, otherwise you always have to know the loading order of the program).

Here is my simple method of violence:

I gave him a chance to rest, let it rest for 120 seconds, and then execute it, that is, every time it starts, it does not bind ip immediately, but sleeps for 120 seconds (loading the network card), and then executes the binding, so that it can solve the problem that it can not be loaded and bound.

Of course, there is also a solution that is to change his loading order (this is left to the partners to dig on their own)

After reading the above, do you know how to solve the websocket self-booting pit in windows? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report