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

Solved socket callback


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lexzor
Veteran Member
Join Date: Nov 2020
Old 07-12-2023 , 03:43   socket callback
Reply With Quote #1

hello all, hope you all are good

i'm searching for some tcp socket module that has a callback function which is called when data is received


i already found this https://forums.alliedmods.net/showthread.php?t=262924 but it seems really buggy.

is there any module that have this feature?

if not, i would try to create my own, is this hard to achieve in cpp?

Last edited by lexzor; 07-13-2023 at 04:33.
lexzor is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 07-12-2023 , 15:54   Re: socket callback
Reply With Quote #2

The module is basically looping until data is available, you can do that yourself in the plugin. Either by using set_task() or a thinking entity.

If you want to go the module route the easies way would be to fix the bugs in the existing module. The module itself is not very complicated, the bugs might be.
__________________
Black Rose is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-12-2023 , 20:49   Re: socket callback
Reply With Quote #3

I put together something like you're looking for 10+ years ago. I don't recall where I left off but I attached the files if you want to give it a try.

More info here:
https://forums.alliedmods.net/showthread.php?t=169315
Attached Files
File Type: inc sockets_forwards.inc (8.2 KB, 17 views)
File Type: dll sockets2_amxx.dll (97.5 KB, 20 views)
File Type: inc sockets2.inc (1.2 KB, 11 views)
__________________

Last edited by Bugsy; 07-13-2023 at 00:55.
Bugsy is offline
lexzor
Veteran Member
Join Date: Nov 2020
Old 07-13-2023 , 04:31   Re: socket callback
Reply With Quote #4

Quote:
Originally Posted by Black Rose View Post
The module is basically looping until data is available, you can do that yourself in the plugin. Either by using set_task() or a thinking entity.

If you want to go the module route the easies way would be to fix the bugs in the existing module. The module itself is not very complicated, the bugs might be.
Thanks for your response, i will use this method, didn't know it's using same method. I used it with set_task but at that time it was looking like a overkill.


Quote:
Originally Posted by Bugsy View Post
I put together something like you're looking for 10+ years ago. I don't recall where I left off but I attached the files if you want to give it a try.

More info here:
https://forums.alliedmods.net/showthread.php?t=169315
Thanks for sharing, i forgot this thread even i saw it ~1 month ago. I will give it a try because i'm still practicing c++ as a hobby.

Last edited by lexzor; 07-13-2023 at 04:32.
lexzor 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 08:08.


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