advise with .net remoting

the client (which is a server too) check if the server has a task for him
if there is avaliable task then the client operate a function in the server that return a class named (TaskClass).

on the client side i wrote a class that contain 2 variables - one is clientID and the other one is instance of TaskClass.

i put the class "TaskClass" in a class library as a dll ,this class is serializable.


is it reasonable is it a "good programming"
im not sure about what i did...it seems a little bit clumsy. 
thanks in advanced



Answer this question

advise with .net remoting

  • kabalweg

    Hi ppl1,

    There is nothing clumsy about having a remotable type in a separate DLL.
    It is perfectly fine to do what you have done.

    Regards,
    Vikram



  • otakung

    ok
    Thanks again :)

  • daveodolph

    great, thanks.

    another problem im having is that i need to give a client a unique id , so i think i will count each client that connected to the server and give him that number.

    how to "give" the client his id i know it not right to put it in the TaskClass and if i will create a method in the remote object to give him the id then it will be like the client operate 3 methods until he starts exectute a job (first to check if a task is avaliable, then to get his id and then to get the task).
    so how can i do that right

  • GGiant

    Hi,

    There are quite a few options. One is to have the ClientId as a parameter to all methods as a ref parameter. On the first call, you assign it on server and the client maintains it on the client side for all calls in that session.

    The other idea would be to use the CallContext. You can directly embed the ClientId and send it across or 

    See link below for more details:
    http://msdn.microsoft.com/library/default.asp url=/library/en-us/cpref/html/frlrfsystemruntimeremotingmessagingcallcontextclasstopic.asp

    Regards,
    Vikram



  • advise with .net remoting