| View previous topic :: View next topic |
| Author |
Message |
jars Guest
|
Posted: Wed Apr 25, 2007 6:25 pm Post subject: distribution mechanism |
|
|
Hi,
I've an app that work as TCP Server in a Lan that sends ~60K of
data every 5 seconds to 30 client app's. It work fine by now
but it turn so dificult because the clients turn to 200 and this
schema is not possible. I think the solution is multicast with
UDP but there is no guarantee about the order and arrive of data
to the clients. I have no idea about how deal with it. Can
somebody show me or send me an example of code in both sides,
remember the size of package is about 60Kb.
If somebody knows some other distribution mechanism are welcome.
I'm developing with Delphi 7 and WinSocks |
|
| Back to top |
|
 |
Jamie Dale Guest
|
Posted: Wed Apr 25, 2007 7:34 pm Post subject: Re: distribution mechanism |
|
|
I don't think UDP is going to be the answer in your situation really
In reality I don't think there is a easy answer to your task unless you have
multiple servers which act as repeaters for the main server.
Others might have a better idea...
"jars" <jrodriguezsoto (AT) tecnovoz (DOT) com> wrote in message
news:462f56ae (AT) newsgroups (DOT) borland.com...
| Quote: | Hi,
I've an app that work as TCP Server in a Lan that sends ~60K of
data every 5 seconds to 30 client app's. It work fine by now
but it turn so dificult because the clients turn to 200 and this
schema is not possible. I think the solution is multicast with
UDP but there is no guarantee about the order and arrive of data
to the clients. I have no idea about how deal with it. Can
somebody show me or send me an example of code in both sides,
remember the size of package is about 60Kb.
If somebody knows some other distribution mechanism are welcome.
I'm developing with Delphi 7 and WinSocks
|
|
|
| Back to top |
|
 |
Jamie Dale Guest
|
Posted: Wed Apr 25, 2007 7:41 pm Post subject: Re: distribution mechanism |
|
|
I've had another thought.
What about the client app sending a 'get'/'refresh' command to the server? -
That way each AThread can send it's own data - Not just one thread cycling
through all the connected clients.
Thats the only other thought I have. Maybe Remy has some ideas.
"jars" <jrodriguezsoto (AT) tecnovoz (DOT) com> wrote in message
news:462f56ae (AT) newsgroups (DOT) borland.com...
| Quote: | Hi,
I've an app that work as TCP Server in a Lan that sends ~60K of
data every 5 seconds to 30 client app's. It work fine by now
but it turn so dificult because the clients turn to 200 and this
schema is not possible. I think the solution is multicast with
UDP but there is no guarantee about the order and arrive of data
to the clients. I have no idea about how deal with it. Can
somebody show me or send me an example of code in both sides,
remember the size of package is about 60Kb.
If somebody knows some other distribution mechanism are welcome.
I'm developing with Delphi 7 and WinSocks
|
|
|
| Back to top |
|
 |
Mike Williams (TeamB) Guest
|
Posted: Wed Apr 25, 2007 7:51 pm Post subject: Re: distribution mechanism |
|
|
Jamie Dale wrote:
| Quote: | What about the client app sending a 'get'/'refresh' command to the
server? - That way each AThread can send it's own data
|
That's a better approach. I don't like the idea of servers iterating
through all connected clients. You might have one client on a very
slow connection that should only get new data every minute, etc.
Another thing to consider is the amount of data being sent. It might
be possible to reduce using a compression scheme. I don't necessarily
mean zipping of the data each time but rather coming up with a
mechanism to send only changes, for example.
--
-Mike (TeamB) |
|
| Back to top |
|
 |
jars Guest
|
Posted: Thu Apr 26, 2007 1:06 am Post subject: Re: distribution mechanism |
|
|
This is not possible because it;s a real-time process that show the state
for every pc station in a call-center.
The server sends metrics, current agent state, amount queue calls, amount
time queue calls, etc.
When a pc station turn from "not available" to "Ready" state, must need to
be notified to the supervisors client stations, etc.
Jorge
"Jamie Dale" <jamie.dale (AT) yahoo (DOT) com> wrote in message
news:462f68aa$1 (AT) newsgroups (DOT) borland.com...
| Quote: | I've had another thought.
What about the client app sending a 'get'/'refresh' command to the
server? - That way each AThread can send it's own data - Not just one
thread cycling through all the connected clients.
Thats the only other thought I have. Maybe Remy has some ideas.
"jars" <jrodriguezsoto (AT) tecnovoz (DOT) com> wrote in message
news:462f56ae (AT) newsgroups (DOT) borland.com...
Hi,
I've an app that work as TCP Server in a Lan that sends ~60K of
data every 5 seconds to 30 client app's. It work fine by now
but it turn so dificult because the clients turn to 200 and this
schema is not possible. I think the solution is multicast with
UDP but there is no guarantee about the order and arrive of data
to the clients. I have no idea about how deal with it. Can
somebody show me or send me an example of code in both sides,
remember the size of package is about 60Kb.
If somebody knows some other distribution mechanism are welcome.
I'm developing with Delphi 7 and WinSocks
|
|
|
| Back to top |
|
 |
Mike Williams (TeamB) Guest
|
Posted: Thu Apr 26, 2007 1:15 am Post subject: Re: distribution mechanism |
|
|
jars wrote:
| Quote: | This is not possible because it;s a real-time process that show the
state for every pc station in a call-center.
|
What about a UDP broadcast to all clients simply indicating that new
data is available. In response the client would make a request to the
server for the data which would have a thread sending to each client.
As it is your "every 5 seconds" is arbitrary and close to, but not
exactly, real time. It sounds like you're sending the data every 5
seconds even if nothing has changed.
--
-Mike (TeamB) |
|
| Back to top |
|
 |
jars Guest
|
Posted: Thu Apr 26, 2007 7:11 pm Post subject: Re: distribution mechanism |
|
|
In fact if a pc station, for example turns from "Not Ready" to "Ready" I
must send inmediatly this situacion to the clients and if after 1 second
there are another state change I must send again. If no changes then every
5" send data. The state changes and then new call queues are in real-time,
the rest of statistics send every 5"
"Mike Williams (TeamB)" <mlwi!!iams@gmail!.com> wrote in message
news:xn0f5dp83beo3u400d (AT) newsgroups (DOT) borland.com...
| Quote: | jars wrote:
This is not possible because it;s a real-time process that show the
state for every pc station in a call-center.
What about a UDP broadcast to all clients simply indicating that new
data is available. In response the client would make a request to the
server for the data which would have a thread sending to each client.
As it is your "every 5 seconds" is arbitrary and close to, but not
exactly, real time. It sounds like you're sending the data every 5
seconds even if nothing has changed.
--
-Mike (TeamB) |
|
|
| Back to top |
|
 |
Jamie Dale Guest
|
Posted: Fri Apr 27, 2007 8:24 pm Post subject: Re: distribution mechanism |
|
|
"Mike Williams (TeamB)" <mlwi!!iams@gmail!.com> wrote in message
news:xn0f5dp83beo3u400d (AT) newsgroups (DOT) borland.com...
| Quote: | jars wrote:
This is not possible because it;s a real-time process that show the
state for every pc station in a call-center.
What about a UDP broadcast to all clients simply indicating that new
data is available. In response the client would make a request to the
server for the data which would have a thread sending to each client.
As it is your "every 5 seconds" is arbitrary and close to, but not
exactly, real time. It sounds like you're sending the data every 5
seconds even if nothing has changed.
|
Better still, what about a TCP broadcast to all clients to say 'update' and
then each client can then respond with a request for it's 60Kb data which
will then be handled by it's own AThread - Similar to my previous idea.
Surely thats a better idea? - and it avoids UDP.. |
|
| Back to top |
|
 |
Jamie Dale Guest
|
Posted: Sun Apr 29, 2007 2:14 am Post subject: Re: distribution mechanism |
|
|
So... did you consider my last idea?
J
"Jamie Dale" <jamie.dale (AT) yahoo (DOT) com> wrote in message
news:463215b4 (AT) newsgroups (DOT) borland.com...
| Quote: |
"Mike Williams (TeamB)" <mlwi!!iams@gmail!.com> wrote in message
news:xn0f5dp83beo3u400d (AT) newsgroups (DOT) borland.com...
jars wrote:
This is not possible because it;s a real-time process that show the
state for every pc station in a call-center.
What about a UDP broadcast to all clients simply indicating that new
data is available. In response the client would make a request to the
server for the data which would have a thread sending to each client.
As it is your "every 5 seconds" is arbitrary and close to, but not
exactly, real time. It sounds like you're sending the data every 5
seconds even if nothing has changed.
Better still, what about a TCP broadcast to all clients to say 'update'
and then each client can then respond with a request for it's 60Kb data
which will then be handled by it's own AThread - Similar to my previous
idea. Surely thats a better idea? - and it avoids UDP..
|
|
|
| Back to top |
|
 |
Mike Williams (TeamB) Guest
|
Posted: Mon Apr 30, 2007 5:07 am Post subject: Re: distribution mechanism |
|
|
Jamie Dale wrote:
| Quote: | Better still, what about a TCP broadcast to all clients to say
'update' and then each client can then respond with a request for
it's 60Kb data which will then be handled by it's own AThread -
Similar to my previous idea. Surely thats a better idea? - and it
avoids UDP..
|
The only reason I mentioned the possibility of UDP is that UDP allows
for true broadcasting such that the message goes out to all clients
(actually a subnet of IP addresses) at once. With TCP the server would
still have to somehow loop through the clients and send the message one
at a time. I prefer stateless servers where there wouldn't even be a
concept of current clients.
--
-Mike (TeamB) |
|
| Back to top |
|
 |
jars Guest
|
Posted: Tue May 08, 2007 5:57 pm Post subject: Re: distribution mechanism |
|
|
I can't see the advantage of send a broadcast and then each client make a
request if a know that every 1, 2 or 5 seconds I must send the news.
Jorge
"Jamie Dale" <jamie.dale (AT) yahoo (DOT) com> wrote in message
news:463215b4 (AT) newsgroups (DOT) borland.com...
| Quote: |
"Mike Williams (TeamB)" <mlwi!!iams@gmail!.com> wrote in message
news:xn0f5dp83beo3u400d (AT) newsgroups (DOT) borland.com...
jars wrote:
This is not possible because it;s a real-time process that show the
state for every pc station in a call-center.
What about a UDP broadcast to all clients simply indicating that new
data is available. In response the client would make a request to the
server for the data which would have a thread sending to each client.
As it is your "every 5 seconds" is arbitrary and close to, but not
exactly, real time. It sounds like you're sending the data every 5
seconds even if nothing has changed.
Better still, what about a TCP broadcast to all clients to say 'update'
and then each client can then respond with a request for it's 60Kb data
which will then be handled by it's own AThread - Similar to my previous
idea. Surely thats a better idea? - and it avoids UDP..
|
|
|
| Back to top |
|
 |
Mike Williams (TeamB) Guest
|
Posted: Tue May 08, 2007 7:28 pm Post subject: Re: distribution mechanism |
|
|
jars wrote:
| Quote: | I can't see the advantage of send a broadcast and then each client
make a request if a know that every 1, 2 or 5 seconds I must send the
news.
|
If your clients connect and stay connected then you can certainly send
data to every connected client periodically but I don't like that
approach. Assuming your server has a loop that iterates through all
connected clients you could run into the possibility that a single
client has disconnected unexpectedly which, depending on timeout
values, could potentially delay getting the data to the rest of the
clients. The alternative would be looping through connected clients
and launching a separate thread for each client.
If you really do want to send data to all clients every 5 seconds why
not just give each client a timer that requests new data from the
server every 5 seconds? That would greatly simplify the server. If
you're truly running into throughput problems then you might need to
consider multiple servers with load balancing.
--
-Mike (TeamB) |
|
| Back to top |
|
 |
jars Guest
|
Posted: Wed May 09, 2007 1:26 am Post subject: Re: distribution mechanism |
|
|
I would like to know your opinion about traffic lan.
What's best, send data from server to every client every 1, 2 or 5 seconds
or that every client request the data every 1,2 or 5"?
Anyway, the server send's always the data.
Which is the thread limit.
Multicast isn't the solution?
Thanks Mike
Jorge
"Mike Williams (TeamB)" <mlwi!!iams@gmail!.com> wrote in message
news:xn0f5yikltmyoos000 (AT) newsgroups (DOT) borland.com...
| Quote: | jars wrote:
I can't see the advantage of send a broadcast and then each client
make a request if a know that every 1, 2 or 5 seconds I must send the
news.
If your clients connect and stay connected then you can certainly send
data to every connected client periodically but I don't like that
approach. Assuming your server has a loop that iterates through all
connected clients you could run into the possibility that a single
client has disconnected unexpectedly which, depending on timeout
values, could potentially delay getting the data to the rest of the
clients. The alternative would be looping through connected clients
and launching a separate thread for each client.
If you really do want to send data to all clients every 5 seconds why
not just give each client a timer that requests new data from the
server every 5 seconds? That would greatly simplify the server. If
you're truly running into throughput problems then you might need to
consider multiple servers with load balancing.
--
-Mike (TeamB) |
|
|
| Back to top |
|
 |
|