OneWay messages in remoting

Remoting provides a way for fire-and-forget OneWay messages from client to the server. Just adding a [OneWay] attribute to a method of your remoted type would make the method invokation oneway. Something like:

public class Remote : MarshalByRefObject
  public void RemoteMethod ()

  public void RemoteOneWayMethod()

When invoking a oneway method the client will not wait for a response and the call will return immediately. In essence the call gets converted to an async call and the client doesnt wait for a server response.

Note: This behaviour occurs only when invoking a method marked with [OneWay] on a remoting proxy. Invoking the same method on a regular object will not have the desired effect. It will be called synchronously like any other method.

Comments (8)

  1. That is does; however since you are not assured of knowing that the data went through, I’ve always found this feature to be somewhat less than useful.

  2. ManishG says:

    Yes you are correct, it could be useful in a x-appdomain scenario however where you are sure the channel is reliable.


  3. Ah, that’s a very good point. 🙂

  4. Anil says:

    "In essence the call gets converted to an async call and the client doesnt wait for a server response."

    Does that mean that calls to a method marked OneWay would ALWAYS be aynch?

    I need to clean up some temp files on session start.I have the method marked OneWay that does that – but I do not want to wait on files deletion – so I have a delegate hook up that method and I do a MyDelegateInstance.BeginInvoke on the method.

    Is that redundant since the call is already asynch?

    informative blog by the way – thanx

  5. ManishG says:


    This is a good question. I should have clarified this in the post. The async behaviour for [OneWay] messages is true, only when you are invoking a method on a proxy. If you are invoking on a regular object you will not get this behaviour. Hope this clarifies your doubt.