in reply to Re: Notifier - Server
in thread Notifier - Server

Thanks for the help. Yes the clarification is that the client and server have a established connection whatsoever happens. They are bound by sockets. I need to do a recursion like function which would notify me of the changes that took place in the database. Typically a messenger service. The fact is that, threads are still experimental in perl and callbacks are difficult to implement. In these circumstances, recursion leads to stack getting dumped and the server getting too busy with the looping. One more problem is how do I check whether the client is listening all the time, he might have long back exited the program, server keeps sending to pipe which doesn't exist, you can use ping style of loopback to check if the client is receiving or not, crude isn't it. I thought of another method, like using two intermediate clients. Let me explain, I have a server with Unix socket connected to /tmp/data which does the database operation, a client(1) is connected thru Unix socket to the server. This client(1) will in turn act as server for TCP-IP based socket and a windows client(2) will get the notification. Please give your valuable feedback for these methods. Gurudutt

Replies are listed 'Best First'.
Re: Re: Re: Notifier - Server
by jepri (Parson) on Sep 14, 2001 at 11:25 UTC
    Nup. My clarification is that you should drop the 'permanent connection' approach and go with a transaction approach.

    You are taking the wrong approach in recursing through a database to find changes. Either the database or the program which inserts the changes has to be responsible for alerting other programs to the changes.

    When your database grows large (if it grows large) you will be putting a heavy load on the database server.

    Don't use threads, use forks in perl

    'Ping' the client to see if it is still up. If the client quits while the pipe is open, the server will get a sigpipe when it tries to write to the socket.

    By your slightly confused explanation I am guessing that you haven't firmly settled on what you want to do. I recommend do what is easiest, which may involve patching the original program.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.