Results 1 to 5 of 5

Thread: Remoting question

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Norwich, UK
    Posts
    405

    Remoting question

    I'm thinking about writing a distributed application usng .net remoting. but i'm not sure about one thing.

    The app i want to make will consist of a server and a client (surpruise surprise)
    i want the server to always hold an object in memory (a dataset for example).
    the client will query the server, the server will then search the dataset and the return the result.

    How can the remotable object access the server apps dataset (that already exists) without creating the object.

    What i mean is that for performance reasons i want the server to always hold the dataset in memory, and for the remotable object to be able to access it. but i'm not sure how it can.

    I think maybe i'm thinking about this in the wrong way. but essentially what i want is:

    a server that holds an object in memory and that searches that object when requested by a remote client.

  2. #2
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Remoting question

    Create a "Virtual" version of this object in your client.

    Example (an array, in english/pseudocode)

    task 1: load basic info

    client: creates the empty "virtual object" (a class which you create)
    client: requests the total number of rows from the server
    server: returns the rowcount
    client: records this number as a property (so we can now use .length to use in for loops)
    client: request record 7 (for example)
    server: send data for record 7
    client: use data appropriate and request next required data
    client: request rowcount again to check it hasnt changed.

    That would allow for your server to handle a dataset, and clients access it (without actually knowing the information in the dataset)

    the key here is basically the recordcount number.
    However if you are heavily requesting from the dataset it is a better idea to just transfer it over n keep it in memory on the client (unless it changes often, then the above would be the best)

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Aug 2002
    Location
    Norwich, UK
    Posts
    405

    Re: Remoting question

    Thanks for the reply.
    not sure if your approach is what i need.

    I'm thinking, i think of the the folowing arrangement
    client --> remote object --> server

    where the client calls the remote object, which access the object (dataset for example, but it could be a tree, or whatever) on the server, and returns the result to the client.

    What i'm thinking about is how to do a distbuted search. where the client may be any number of clients searching the object on the server. so the client does no processing, other than passing the search criteria, and receiving the result.

  4. #4
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Remoting question

    Quote Originally Posted by sagey
    Thanks for the reply.
    not sure if your approach is what i need.

    I'm thinking, i think of the the folowing arrangement
    client --> remote object --> server

    where the client calls the remote object, which access the object (dataset for example, but it could be a tree, or whatever) on the server, and returns the result to the client.

    What i'm thinking about is how to do a distbuted search. where the client may be any number of clients searching the object on the server. so the client does no processing, other than passing the search criteria, and receiving the result.
    this is the same theory as any database.
    and whether search criteria is sent to manipulate the results sent back or not, makes no difference to the basics of how your program work, whether your server holds the results n releases it in segments, or in a lump sum to be temporarily stored on the clients machine.

    I don't think i understand exactly what it is that you are asking?

  5. #5
    Frenzied Member ntg's Avatar
    Join Date
    Sep 2004
    Posts
    1,449

    Re: Remoting question

    I don't really see a problem with what you want to do. You can do this as follows:

    1. Create a class that will include a shared member variable access through a shared property - this would be your dataset and let's call the class MySharedClass.
    2. Create a class that will access and search the dataset in MySharedClass - this would be the class that's accessible through remoting and let's call this MyRemotableClass.
    3. Create the client that will access MyRemotableClass through remoting.

    Once the server side starts, it can use MySharedClass's methods to load the dataset for use by MyRemotableClass objects. Since the shared dataset isn't a part of MyRemotableClass, it won't serialize/deserialize as part of the remoting calls (only the parts that satisfy the query criteria).

    Hope this all helps,
    Cheers
    "Feel the force...read the source..."
    Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
    .Net tools & open source: DotNetNukelog4NetCLRProfiler
    My open source projects: Thales SimulatorEFT CalculatorSystem Info ReporterVSS2SVNIBAN Functions
    Customer quote: "If the server has a RAID array, why should we bother with backups?"
    Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
    Ignorant quote: "I have no respect for universities, as they teach not practicle stuff, and charge money for"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width