From: TazaTek on

I'm designing a quote/ticker simulator using streams that will emulate
real-time quotes into my program ( a data pumper, if you will).

I'm new to sockets programming, but after reading Beej's guide, and a
few others, I think I have the basics, and can setup the basic
connection between a client and server.

I'm trying to implement a non-blocking , server push mechanism to
emulate a low latency, high performance data feed. In the end, I'd
like to be able to handle 1,000 symbols simultaneously, with each
having up to 100 changes/sec


Couple of questions:

1. Are there any examples out there that have this? I've been Googling
for hours, and haven't found anything. This is what I would think is
a fairly common scenario, so I'm surprised to not find an example (I
did find a broadcast example, but not what I need)

2. I'm stuck on implementing the read/write mechanism itself. I'm
making it simple, by only sending hard-coded values to start, and can
work with variable floats, ints, etc later, but I still seem to "not
get it". Do I just set the client/server into while(1) loops, and
break out when a connection is dropped? Also, how would I break out
of the client read() to write() to the server that there's a change in
status (like symbol changes)?

3. There will only be one client and one server for this, but do I
need to put the client in a thread, since this is occurring in a GUI
(wxWidgets)? (The server is it's own application, so less of a
concern)


If I can be more specific, let me know.

Thanks

Matt





From: Bill Cunningham on

"TazaTek" <kettlewell.enterprises.inc(a)gmail.com> wrote in message
news:96c11c87-2b7e-4bc5-8d21-5d08b4ee8f10(a)q15g2000yqj.googlegroups.com...

[snip]

> 2. I'm stuck on implementing the read/write mechanism itself. I'm
> making it simple, by only sending hard-coded values to start, and can
> work with variable floats, ints, etc later, but I still seem to "not
> get it". Do I just set the client/server into while(1) loops, and
> break out when a connection is dropped? Also, how would I break out
> of the client read() to write() to the server that there's a change in
> status (like symbol changes)?

I am trying to learn the same thing so I don't know if I can be of much
help. Posix has two calls for use with TCP. Recv() and send(). I know you
can of course use the system calls read() and write() but why exactly are
you wanting to use them instead of recv() and send()? I hope the answer
isn't so obvious that I am making a doofus of myself but are you going to be
using TCP or UDP? UDP has similar functions one called sendto().

Bill


From: Bill Cunningham on

"TazaTek" <kettlewell.enterprises.inc(a)gmail.com> wrote in message
news:96c11c87-2b7e-4bc5-8d21-5d08b4ee8f10(a)q15g2000yqj.googlegroups.com...
>
> I'm designing a quote/ticker simulator using streams that will emulate
> real-time quotes into my program ( a data pumper, if you will).
[snip]

Have you ever used read() and write() before? They look intimidating but
aren't that bad in use. I've used them only in writing a file; like fread()
and fwrite() do. With read()'s first parameter it's just a file descriptor
of type int. Like socket()'s first parameter.

Bill

--
"Using USENET too much means you have too much time on your hands."


From: Vladimir Jovic on
TazaTek wrote:
> 2. I'm stuck on implementing the read/write mechanism itself. I'm
> making it simple, by only sending hard-coded values to start, and can
> work with variable floats, ints, etc later, but I still seem to "not
> get it". Do I just set the client/server into while(1) loops, and
> break out when a connection is dropped? Also, how would I break out
> of the client read() to write() to the server that there's a change in
> status (like symbol changes)?
>

You can do blocking read/writes.
If you are doing this in c++, google for serialization.

> 3. There will only be one client and one server for this, but do I
> need to put the client in a thread, since this is occurring in a GUI
> (wxWidgets)? (The server is it's own application, so less of a
> concern)
>

I think so
From: Scott Lurndal on
TazaTek <kettlewell.enterprises.inc(a)gmail.com> writes:
>
>I'm designing a quote/ticker simulator using streams that will emulate
>real-time quotes into my program ( a data pumper, if you will).
>
>I'm new to sockets programming, but after reading Beej's guide, and a
>few others, I think I have the basics, and can setup the basic
>connection between a client and server.
>
>I'm trying to implement a non-blocking , server push mechanism to
>emulate a low latency, high performance data feed. In the end, I'd
>like to be able to handle 1,000 symbols simultaneously, with each
>having up to 100 changes/sec

Note that all the main ticker feeds are multicast UDP. You need to be
real fast to not drop packets.

http://www.exegy.com/tickerplant.html

scott