View Single Post
Shooting King
RAAASENGAN
Join Date: Mar 2012
Location: India
Old 06-01-2015 , 11:12   Re: Module: Threaded Sockets
Reply With Quote #12

Quote:
Originally Posted by joropito View Post
I didn't spent too much time but I can't find where ThreadMain is called from main module.
If I understand correctly, you tried to do the same as on mysql module and other modules you can found. In that case you manage a list of sockets to be polled at each frame or whatever timeframe you want. I can't find that.
When a plugin calls socket_create_t() native, a Thread is created and its Entry function, TheadMain, is attached to that thread. At this moment thread state is set to STATE_IDLE (through the constructor of CThreadedSocket). So in this state, as you can see see from the main post, the Thread does nothing except checking for change in ThreadState.

I don't know exactly how Sqlite threads work, but when i looked at them, they implemented SourceMod Threads, which are not that useful(too complex) in case of Sockets. As you can see, there are no Mutex's no Semaphores etc, etc in this module. I think my Model of implementation is itself synchronous.

Quote:
Originally Posted by joropito View Post
Another question is if you have tried your calls to listent/recv/etc on udp sockets. They work slightly different and could broke how you check for incoming data.
Example ? Although i will be implementing SendTo and RecvFrom functions in this module as per Destro's request.

Thanks for your time reviewing this shit :d
__________________
As every time said, don't ever UNDERESTIMATE me.

Donate - Here
Shooting King is offline