Raised This Month: $ Target: $400
 0% 

Parsing Response Thru Socket


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tenub
Junior Member
Join Date: Aug 2013
Old 05-11-2016 , 22:28   Parsing Response Thru Socket
Reply With Quote #1

If I want to parse a response via socket, this results in a string being received due to the RESP protocol (remote Redis server). I need to then parse this based on the protocol specification, but in Pawn I can't just return the data/type I parse that string to; I must pass a buffer to copy the result to. However, when I parse, it could result in a variable data type (string, integer, array, etc.). Yet the buffer can only handle the data type I declare it as in the calling function before passing it to the parsing function to "fill". I think you may already see my problem. How do I handle variable data types for a buffer? Rather, what is the correct method to retrieve parsed data from a string buffer? I come from a JavaScript background so Pawn is an exceptional hurdle for me.
tenub 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 18:41.


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