Mail Archives: djgpp/1997/09/30/07:55:12
On Mon, 29 Sep 1997, Salvador Eduardo Tropea (SET) wrote:
> Is easy to communicate only 2 process but for more I think is more complex.
> Any ideas?
First, you can have separate buffers for each connection, allocated by
the TSR when the connection is established. Then each pair of
processes only checks its own buffer for any new data.
If that's too complicated, or wastes too much memory, a single buffer
could be used, with a special magic signature at the beginning of data
that identifies the connection. (The first data exchange would then
need to be with some kind of generic sugnature and hold the specific
signature to be used for the rest of the connection.)
There's also a problem of using the same buffer for reading and
writing by several pairs of connected processes. A simple solution
would be to wait until the buffer is emptied (if the message in the
buffer appears to belong to another connection). Another possibility
is to allow appending data to the buffer without destroying its
previous contents and making it possible for the reading side to read
and empty only part of the buffer's data.
Anyway, these problems are solvable, one way or the other. So I would
suggest at first to make this work for a single connection, and leave
improvements to later releases.
- Raw text -