AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Sockets are blocking the main thread (https://forums.alliedmods.net/showthread.php?t=340536)

ghostdlr 11-23-2022 12:43

Sockets are blocking the main thread
 
socket_open seems to be blocking the main thread for 1 second if the remote server is offline.
Does socket send/receive block the thread also?
Is there any way to avoid this?

I'm deciding between using a TCP server with sockets or a web server with AmxxEasyHttp.

The advantage with sockets is that the tcp server can talk back any time.
With AmxxEasyHttp however, I need to do a periodical GET request to receive a list of commands from the web server.


I also want to make the plugin compatible with AMX 1.8 if possible. Does anyone know when AMX 1.9 will come out of beta?

HamletEagle 11-23-2022 16:42

Re: Sockets are blocking the main thread
 
Look into threaded sockets module or soclet_hz module.


All times are GMT -4. The time now is 15:38.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.