English 中文(简体)
How to use PortMode.OptimizedSingleReissueReceiver in an Interleave? (Microsoft CCR)
原标题:
  • 时间:2009-11-18 16:08:35
  •  标签:
  • port
  • ccr

I have read a post on the Microsoft CCR forum on reducing the overhead of calls to Port.Post() [ref.: PortElement Instantiation in the CCR] and I was wondering if there is a similar way to bind a port to its receiver in order to use the port in OptimizedSingleReissueReceiver mode in an interleave arbiter?

I have implemented the following code do use this PortMode on an Interleave:

    // Creates the Receiver 
    Receiver receiver = Arbiter.Receive(true, inputPort, inputPortHandler);
    // Change the port mode before binding the Receiver with the DispatcherQueue
      inputPort.Mode = PortMode.OptimizedSingleReissueReceiver;         

    // Creates the Interleave
    ExclusiveReceiverGroup exclusiveReceiverGroup = new ExclusiveReceiverGroup(receiver);
    Interleave interleave = Arbiter.Interleave(new TeardownReceiverGroup(), 
                                                            exclusiveReceiverGroup, 
                                                            new ConcurrentReceiverGroup());         
    // Activate the Interleave 
    Arbiter.Activate(dispatcherQueue, interleave);

At first, it seemed ok, however I still got NullReferenceException from time to time (this exception indicates that the port is not bound to a receiver yet).

Does anyone know another way to use PortMode.OptimizedSingleReissueReceiver inside an Interleave?

问题回答

暂无回答




相关问题
how do you fix the clients outgoing port number using php?

I m using php (the sockets extension) to handle sending and receiving xml files. I d like to be able to fix the outgoing clients port number as the server has a set amount of incoming connections. I ...

Making a Ruby server work on port 80

I m creating a simple web server in Ruby, which display s the text LOLZ in the browser. I have this now: #!/usr/bin/ruby require socket server = TCPServer.open(2000) loop do client = server....

C# Discover the LocalEndPoint AddressFamily port number

When I establish a tcp connection to a server using the TcpClient class, is there any way to find out the source port of this connection? I am trying to implement the exec protocol and stderr port ...

Listen to a port that is in use [duplicate]

Possible Duplicate: Get connecting IP from specified ports that using by other program. If a port is used by a program, is there any way I can listen that port and get the connected IP on that ...

Can t access locally hosted project via the internet?

I m currently developing a Java Servlet Project in Eclipse. The project is compiled via Tomcat 5.5 and hosted in localhost:8080(alternatively 127.0.0.1:8080 AND 192.168.1.10:8080 which also happens ...

热门标签