| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Client/server - two choices |
Hi Peter.
PS>> How do I do it? I suppose there has to be some sort of
PS>> combination of queues
PS>> and pipes. I could use queues to send messages to the
PS>> server, like "read the
PS>> next 23 bytes", then the server would put the 23 bytes in
a pipe that
PS>> the
DM> How about the queue says, "On pipe \pipe\bbs\node1, give me message #8
DM> in message area handle 0x12345678," and the message is put in the
DM> pipe. If the client reads the first 8 bytes and says,
"Nope," it can
DM> just flush the pipe.
You even can use "\\workstation\pipe\bbs\node1", ie share your
station among two or 2000 CPUs ;) And I don't think that sending 2-3 kb of
message is really hard for cpu -- in my case, sending 1.5-2M through pipes
beetween two workstations takes not so much time, including search through
index at server and dropping useless records at client. I use general
protocol
------------------------------------------------------------------------------
client : connect to "\\server\pipe\db\datafile"
client : "create new data server for me"
server : "created new data server named \\server\pipe\db\datafile.25"
server : hang up
client : connect to "\\server\pipe\db\datafile.25"
loop:
client : "send me records those have sid=1000"
dataserver: requests mutex and accesses datafile (really,index in RAM)
dataserver: releases mutex and sending records into pipe
client : while(more) get rec; check it; if useless, drop it; else store it;
goto loop;
-------------------------------------------------------------------------------
Server is the thread. Data server is the thread too. It being created for
every request to server. After that server forgets about it. The only case
when system blocks is when one of the data servers trying to send whole
datafile. But in that place in protocol I've inserted
DosReleaseMutexSem(blocksem);
DosRequestMutexSem(blocksem);
for every 100 processed records. It gives opportunity for other threads to
get their portion of info.
Such approach, m.b., ugly, but if you divide your bbs into small
independent part, it will much clear for you, and easily to tune and even
rebuild totally.
bye. [Team OS/2]
dozen
--- FleetStreet 1.19 NR
* Origin: живи и дай умереть (2:5030/297.31)SEEN-BY: 50/99 54/99 270/101 620/243 625/160 711/401 413 430 934 712/311 407 SEEN-BY: 712/505 506 517 623 624 704 713/317 800/1 @PATH: 5030/297 110 48 16 464/34 5100/8 396/1 270/101 712/624 711/934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.