Board index » cppbuilder » Sending/ Receiving data via LAN

Sending/ Receiving data via LAN

I'm using two threads in a program. They are sharing a ring buffer. As soon
as thread A has inserted a record in the buffer it will resume thread B. B
will consume the data until the buffer (FIFO) is empty. Then it go to
suspended state.

How can I do this with two applications via LAN (a data record has 2
integers and 1 string)?
I assume that thread B can't be 'woken up' by thread A via LAN, does B has
to poll the data?

I'm absolute newbie in LAN programming. So, all information is welcome.
By the way, is there any software which can simulate LAN on a single
machine so that the applications can be run on one PC in the development
phase.

Thanks
Phuoc Can HUA

--
_/\__/\__/\__/\__/\__/\_
www.huaonline.com
My Homepage is my Castle

 

Re:Sending/ Receiving data via LAN


"Phuoc Can HUA" <home}a+t{huaonline.com> wrote in message
news:oprn0rrordbq7az6@newsgroups.borland.com...

Quote
> How can I do this with two applications via LAN (a
> data record has 2 integers and 1 string)? I assume that
> thread B can't be 'woken up' by thread A via LAN,
> does B has to poll the data?

That depends on how the two applications are communicating with each other
to begin with.  Are you using Named Pipes?  Sockets?  RPC?  ActiveX/COM?
Other?  Each one of those technologies handle data transmissions
differently.  Some need data to be polled periodically, while some trigger
notifications when data is available.

Quote
> By the way, is there any software which can simulate LAN
> on a single machine so that the applications can be run on
> one PC in the development phase.

Any of the above-mentioned technologies can be used in a single-PC
environment.  It's just a matter of specifying the appropriate connection
values that represent the local machine.  For example, named pipes can use
the local machine name that is returned by GetComputerName(), while sockets
can use the special loopback IP address "127.0.0.1".

Gambit

Re:Sending/ Receiving data via LAN


On Tue, 22 Apr 2003 10:16:02 -0700, Remy Lebeau (TeamB)

Quote
<gambi...@yahoo.com> wrote:
> That depends on how the two applications are communicating with each
> other
> to begin with.  Are you using Named Pipes?  Sockets?  RPC?  ActiveX/COM?
> Other?  Each one of those technologies handle data transmissions
> differently.  Some need data to be polled periodically, while some
> trigger
> notifications when data is available.

What can you suggest? Okay, I give you more details. What I need is...
- A kind of broadcast, it could be many clients and the server doesn't need
to send to each client.
- Data sending out consists of 2 integers and one string (< 32 bytes).
- The data is a kind of events, there are clock ticks (few times per 1s)
and from time to time (not more than once in 1s) there's a special event.
The idea is have something running in synch with the server.
Bottom line, I need something with little delay for small data record, i.e.
less protocol overhead, no security required.

What Can you recommend me? What's best supported in BCB5?

Thanks
Phuoc Can HUA

--
_/\__/\__/\__/\__/\__/\_
www.huaonline.com
My Homepage is my Castle

Other Threads