Raised This Month: $51 Target: $400
 12% 

Sockets are blocking the main thread


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ghostdlr
Senior Member
Join Date: Aug 2010
Old 11-23-2022 , 12:43   Sockets are blocking the main thread
Reply With Quote #1

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?

Last edited by ghostdlr; 11-23-2022 at 12:46.
ghostdlr is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 11-23-2022 , 16:42   Re: Sockets are blocking the main thread
Reply With Quote #2

Look into threaded sockets module or soclet_hz module.
__________________
HamletEagle is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:30.


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