Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am using shared memory as my IPC.Here I am having some web pages.Using shared memory ,I am opening ,and here this web page every 30 seconds it is refreshing.And aslo,same page is used by both server and client.For Ex=rediff.com home page.If every 30 second ,it is updating means,every client can see the changes.
Now,my problem is how to update it.I mean ,how to save this ?
I do not understand what you are trying to do and why, so it might help for you to restate your situation/question. That said, taking your question at face value:
If you want to save the shared state to disk for later access - maybe you could have a special client process that just saves it.
If you want to update the memory with what you download, I think you can just change it and the clients should see it (if that is what you are doing/want to do, I would suggest that you investigate locking for this).
I am having some web pages ,that is opened by a server,And now one client is opening a same page and that is going to update that page and same page can see by both server and client.Now ,if server is changing some thing on that page,then client can
see the updates.
Are you talking about an HTTP server and HTTP clients?
Why do you want to use shared memory? Why not a file?
If you are talking about a mechanism to allow updating a file without restarting the server - why are you trying to impliment this on your own? Is there some reason you are not using thttpd, apache, jigsaw or some other HTTPD?
If you want to have two processes send data to each other, why not use pipes, named pipes, or specific memory segments?
I am using shared memory segments to store those parameter values whatever changed by server/client.
Is it not possible from shared memory, if suppose I am using some file?
Would you be able to post a sample of your code (maybe not everything, but just a small example of what you want to do)?
I do not do much with IPC SHM, but from my understanding, there is nothing to stop you from reading what is in some portion of the SHM. Are you having trouble with that?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.