Click here to Skip to main content
15,887,328 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
Dear all

I am making my own application to receive packet from NSE sever and i am success in it. But my problem is all the packets is in byte format. now how can I get LIVE quotes of any company(scrips)to decode these packets. When I store these bytes in text file it looks like :
 YZ**123 @

How can I get Live feed from this .
I successfully map to the structure
C++
Struct {
CHAR cNetId [2]
SHORT iNoPackets
CHAR cPackData [534]
} BcastPackData

and i got iNoPackets value is 256, but i can't map with cPackData bcz my byte array length is 512. pls help me..
Posted
Updated 25-Jun-12 22:35pm
v2
Comments
Richard MacCutchan 26-Jun-12 4:48am    
You need to find out from the people who provide the feed, what is the format of each message. You can then parse it into its constituent parts and print the information in readable form.
Member 8576662 29-Jun-12 5:37am    
I have ip address and udb address, i have successfully connected to that server which providing feed. The document of this topic is
www.nseindia.com/content/press/FOBroadcast_Ver1.0.4.pdf. i got packet data of 512bytes but i can't map to any structure.. pls help me
Richard MacCutchan 29-Jun-12 6:04am    
All the information you need is in that document; if you cannot figure out the structure from that information I guess you need to rethink what application you want to create.
Vivek Rana 13-Nov-14 5:03am    
i have the same problem can you help me out if u solved it
dewang123 5-Apr-19 0:40am    
Do you have a working solution for this?

you must align your data to the source format. You must pay attention to the NSE data width and byte order and copy each part of it own, because it looks like you use 2-byte chars and the NSE 1 byte chars,
 
Share this answer
 
Comments
dewang123 5-Apr-19 0:41am    
Do you have a working solution for this?
the number of packets you received as 256 ( 1 packet ) means you have to convert into the network byte order by using ntohs(iNopackts). After that based on the packet count, you decompress with the lzo algorithm. then get your broadcast message by providing the offset values.
 
Share this answer
 
v2
Comments
OriginalGriff 5-Mar-19 6:29am    
Reason for my vote of one: the answer has nothing to do with the question.

While I applaud your willingness to help, this question was posted nearly seven years ago, and has an answer that is both relevant and probably correct, even if it was posted a year too late. Yours isn't relevant, and is far too late to be of use.

Please do not post replies to old questions - after all these years, it's quite likely he is no longer interested in another solution.
And it makes you look like either a rep-point farmer, or a spammer "testing the water". I'm pretty sure that neither applies to you in this case, but others are a lot more "trigger-happy" and will start the process of banning your from the site for this.

Please try to stick to "new" questions instead, or you will get thrown off!
Member 14171262 5-Mar-19 7:26am    
Okay. I understand that this was asked about years ago. I thought, if anyone from the outside view this question might get some idea about the 256 which resembles for 1 packet and the further seq. that's why i added my answer. I didn't know this will make me banned from this couch. Thanks for letting me know Admin and you can state the direct situation without describing my looks, i can understand, And today only i created this account, So i will be careful while giving the solutions for other questions in future.
dewang123 5-Apr-19 0:41am    
Do you have a working solution for this?
neo100894 22-Apr-23 5:33am    
Do you have working solution of this? i'm too facing similar issue

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900