Joined: |
Jan 30, 2008 09:03 PM |
Last Post: |
Feb 2, 2008 09:36 AM |
Last Visit: |
Feb 2, 2008 09:36 AM |
Website: |
|
Location: |
Florida |
Occupation: |
java developer |
Interests: |
stock trading |
|
AIM: |
|
ICQ: |
|
MSN IM: |
|
Yahoo IM: |
|
|
jpaladin has contributed to 2 posts out of 21251 total posts
(0.01%) in 6,079 days (0.00 posts per day).
20 Most recent posts:
I am new to sockets, and figuring out this sample application code :
while (true ) {
line = in.readLine();
sout.write(line+"\r\n"); sout.flush();
if (line.trim().equals("x") ) {break;}
}
So, why does in.readLine() block, and what could it possibly be waiting for ? Setting a break point after in.readLine() it never hits. I guess socket code blocks by default when you tell it to read, and it is empty ?
I see that "in" is a System.in socket, so I guess it is some kind of global server socket.
When it gets something, it is reflected to the IQFeed socked that I watch for my data, so I would like to know what I might have to deal with while watching the data.
if an "x" arrives my whole feed is going to be shutdown.
So, I would like to better understand this code.
Joe paladin
If I read these posts correctly, the datafeed sends the actual trades, with the correct time stamps, but they don't always arrive in time stamp order ?
I believe that my graphing code could tolerate this, since it just draws lines between the next two data points. However, this could throw a big wrench in my analysis routines which assume that ticks loaded to a vector are moving forward in time.
I could add a method to reorder the ticks, which would be fine for graphing at the end of the day. Reordering would to be to expensive to apply in realtime though.
I may need to add a filter that drops any back dated ticks before they get added to my tick stream Vector. This approach might also work for SierraChart.
Joe paladin
|
|