By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,779 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,779 IT Pros & Developers. It's quick & easy.

InProc/OutProce memory sharing

P: n/a
I have two exes and would like to share a simple boolean variable among two
exes. The client will setup the value for hte boolean while the server will
read
it.How do I do that?
I have a Server.exe and I have a client.exe

Client.exe setups the value and I want my server.exe to read it.
I do not want to save to a file/db, I want to do it on the memory level.

Any pointers will be helpful
source
Mar 21 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a

you could use remoting.

Set up a the server.exe to accept client connections, and then have it
poll the server.exe for the value of the shared variable.

source wrote:
I have two exes and would like to share a simple boolean variable among two
exes. The client will setup the value for hte boolean while the server will
read
it.How do I do that?
I have a Server.exe and I have a client.exe

Client.exe setups the value and I want my server.exe to read it.
I do not want to save to a file/db, I want to do it on the memory level.

Any pointers will be helpful
source

Mar 22 '06 #2

P: n/a
John,
Could you be little more specific.
I have tried using remoting and all that I could think of.
My problem is, I have a static structure which I try to access from my
client.
Now I am able to access the static properties exposed by my static structure
(class/structure) but when I am back on server the properties that were
initialized by client do not retain those values and when the server tries
to access those properties I do not get those values that were set by the
client.
So essentially the static properties do not retain the values when the
server tries to access them.

source
"John Bailo" <ja*****@texeme.com> wrote in message
news:44**************@texeme.com...

you could use remoting.

Set up a the server.exe to accept client connections, and then have it
poll the server.exe for the value of the shared variable.

source wrote:
I have two exes and would like to share a simple boolean variable among
two
exes. The client will setup the value for hte boolean while the server
will read
it.How do I do that?
I have a Server.exe and I have a client.exe

Client.exe setups the value and I want my server.exe to read it.
I do not want to save to a file/db, I want to do it on the memory level.

Any pointers will be helpful
source


Mar 22 '06 #3

P: n/a

Have you looked at all the Remoting examples for setting up a chat server?

Specifically, look at how it registers the list of names of people who
connect to the server.

As each client connects, it can read the list of available people. And
as that list changes, you can have a remoted event that updates the client.

You don't need to "poll" the server -- that's the beauty of remoting --
you can remote methods so that clients are automatically updated as
values on the server change.

source wrote:
John,
Could you be little more specific.
I have tried using remoting and all that I could think of.
My problem is, I have a static structure which I try to access from my
client.
Now I am able to access the static properties exposed by my static structure
(class/structure) but when I am back on server the properties that were
initialized by client do not retain those values and when the server tries
to access those properties I do not get those values that were set by the
client.
So essentially the static properties do not retain the values when the
server tries to access them.

source
"John Bailo" <ja*****@texeme.com> wrote in message
news:44**************@texeme.com...
you could use remoting.

Set up a the server.exe to accept client connections, and then have it
poll the server.exe for the value of the shared variable.

source wrote:
I have two exes and would like to share a simple boolean variable among
two
exes. The client will setup the value for hte boolean while the server
will read
it.How do I do that?
I have a Server.exe and I have a client.exe

Client.exe setups the value and I want my server.exe to read it.
I do not want to save to a file/db, I want to do it on the memory level.

Any pointers will be helpful
source

--
http://www.you-saw-it-here-first.com
fueled by Texeme Textcasting
Mar 22 '06 #4

P: n/a
Hello, source!

If the only thing you want do is reading bool flag then you can use named mutex object for this. If mutex is occupied that flag equals to true, otherwise - false. Or even better - you can check if mutex with special name exists then flag is true, otherwise - false.

--
Regards, Vadym Stetsyak
www: http://vadmyst.blogspot.com
Mar 22 '06 #5

P: n/a
Hello John,
I understand what you are trying to say that server does not need to poll
anything because it exposes the api for the client to do housekeeping.
I am refering to the chat application you mentioned.

But in my case, once the client connects, my client is going to initialize a
boolean, which my server has to READ it.
So I want a mechanism where if client initializes a variable, I wante the
server to read it.

In most of the chat applications I saw over the internet all the server does
is creates a channel and waits on
COnsole.Readline()
there is not interaction of the server with any of the datastructure that is
being used by the client.

So this brings me to wonder if in remoting can you get hold of an existing
instance of the server rather than creating a new instance of the server?
which will enable to share variables

source
"John Bailo" <ja*****@texeme.com> wrote in message
news:44************@texeme.com...

Have you looked at all the Remoting examples for setting up a chat server?

Specifically, look at how it registers the list of names of people who
connect to the server.

As each client connects, it can read the list of available people. And
as that list changes, you can have a remoted event that updates the
client.

You don't need to "poll" the server -- that's the beauty of remoting --
you can remote methods so that clients are automatically updated as values
on the server change.

source wrote:
John,
Could you be little more specific.
I have tried using remoting and all that I could think of.
My problem is, I have a static structure which I try to access from my
client.
Now I am able to access the static properties exposed by my static
structure (class/structure) but when I am back on server the properties
that were initialized by client do not retain those values and when the
server tries to access those properties I do not get those values that
were set by the client.
So essentially the static properties do not retain the values when the
server tries to access them.

source
"John Bailo" <ja*****@texeme.com> wrote in message
news:44**************@texeme.com...
you could use remoting.

Set up a the server.exe to accept client connections, and then have it
poll the server.exe for the value of the shared variable.

source wrote:
I have two exes and would like to share a simple boolean variable among
two
exes. The client will setup the value for hte boolean while the server
will read
it.How do I do that?
I have a Server.exe and I have a client.exe

Client.exe setups the value and I want my server.exe to read it.
I do not want to save to a file/db, I want to do it on the memory
level.

Any pointers will be helpful
source

--
http://www.you-saw-it-here-first.com
fueled by Texeme Textcasting

Mar 23 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.