Click here to Skip to main content
15,881,852 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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 . If anybody know pls help me?

Thanks and regards
Raghvendra kumar Roy
Posted
Comments
Goutam Patra 8-Dec-10 2:51am    
See my Edited answer.
Goutam Patra 8-Dec-10 6:16am    
Post a new question and ask for twiddling. Someone will help you out in that regard or may be i will be ther.

NSE has documented the whole structures of all kind of packets. You need to go through that. Without that documentation you will not be able to do anything further. And I mean that. And moreover its not that easy what you are thinking at all.

[EDIT]
OK, See i cant help you al the way.
But see
As per the documentation The first char is the NETID. Now your packet says the first char is 4. Leave the next char. The next 2 bytes denotes the no of packet. Here you should take a note the data types such as UINT, SHORT, LONG and DOUBLE contained in a packet, which occupy more than one byte should be twiddled (byte reversed). So after twiddling the 2 bytes of no of packet you will get 1. That means the packet contain one Packet. And so on.
Note the packet may contain compressed/decompressed data or may be both.
I am sorry I cant help you any further.

Now go through the document and carry on.

Good luck
[ END EDIT]
 
Share this answer
 
v2
Comments
Raghvendra Kumar Roy 8-Dec-10 2:21am    
Thanks Gautam,
Ya I know and I read NSE Documents. But the structure of packet is different in NSE Documents.In Nse Documents first field must be 0 or 1. But I am receiving different format. After that documents says that we have to use LZO algo. but structure is diffrent. so I do I olve these problems. Give me any HINT. I am developing it in .net Console Application.
Raghvendra Kumar Roy 8-Dec-10 6:05am    
Thanks again for help me. Some things are clear But Pls tell me more clear. As per Documentation the first char is 4 and I am receiving same. Now Second char is 32, Third is 0, fourth is 1, fifth is 0,sixth is 0, seventh is 4 and so on... Now can u tell me how do I twiddled it to know this is compressed or not. I am not asking u about code. Just tell me how I twiddled it.
Go through the below links .., this may slove your problem

http://nmap.org/book/nse-library.html[^]

http://nmap.org/nsedoc/lib/dns.html[^]
 
Share this answer
 
Comments
Dalek Dave 8-Dec-10 3:50am    
Good Links.
What do you mean "packet"?? Are you getting raw binary data over TCP/IP from the NSE server? Without the documentation on the format of the data in the packet, you're just guessing at what you have to do, and so would we.
 
Share this answer
 
Comments
Raghvendra Kumar Roy 8-Dec-10 2:15am    
Thanks Dave,
Ya packet means raw binary data. when we write it into text file then it prints only some symbols. How can I get a readable formats?
I'm willing to bet that if you look around with google, you'll find guyidelines and even examples of how to decode the data you're getting.

BTW, did you mean NYSE?
 
Share this answer
 
Comments
Goutam Patra 7-Dec-10 8:33am    
[did you mean NYSE?] NSE->National Stock Exchange (India)

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