Use Selector to multiplex Pipe.SourceChannels?

Hi,
i am a little confused. I 'd like an object to have some references to multiple Pipe.SourceChannels and periodically check for incomig data. MultiPortEcho.java seems to do what i want, but by using SocketChannels.
Do i have to do something similar? Create a Selector, get the keys and check for OP_ACCEPT and OP_READ?
MultiPortEcho.java
ibm.com/developerWorks
import java.io.*;
import java.net.*;
import java.nio.*;
import java.nio.channels.*;
import java.util.*;
public class MultiPortEcho
  private int ports[];
  private ByteBuffer echoBuffer = ByteBuffer.allocate( 1024 );
  public MultiPortEcho( int ports[] ) throws IOException {
    this.ports = ports;
    go();
  private void go() throws IOException {
    // Create a new selector
    Selector selector = Selector.open();
    // Open a listener on each port, and register each one
    // with the selector
    for (int i=0; i<ports.length; ++i) {
      ServerSocketChannel ssc = ServerSocketChannel.open();
      ssc.configureBlocking( false );
      ServerSocket ss = ssc.socket();
      InetSocketAddress address = new InetSocketAddress( ports[i] );
      ss.bind( address );
      SelectionKey key = ssc.register( selector, SelectionKey.OP_ACCEPT );
      System.out.println( "Going to listen on "+ports[i] );
    while (true) {
      int num = selector.select();
      Set selectedKeys = selector.selectedKeys();
      Iterator it = selectedKeys.iterator();
      while (it.hasNext()) {
        SelectionKey key = (SelectionKey)it.next();
        if ((key.readyOps() & SelectionKey.OP_ACCEPT)
          == SelectionKey.OP_ACCEPT) {
          // Accept the new connection
          ServerSocketChannel ssc = (ServerSocketChannel)key.channel();
          SocketChannel sc = ssc.accept();
          sc.configureBlocking( false );
          // Add the new connection to the selector
          SelectionKey newKey = sc.register( selector, SelectionKey.OP_READ );
          it.remove();
          System.out.println( "Got connection from "+sc );
        } else if ((key.readyOps() & SelectionKey.OP_READ)
          == SelectionKey.OP_READ) {
          // Read the data
          SocketChannel sc = (SocketChannel)key.channel();
          // Echo data
          int bytesEchoed = 0;
          while (true) {
            echoBuffer.clear();
            int r = sc.read( echoBuffer );
            if (r<=0) {
              break;
            echoBuffer.flip();
            sc.write( echoBuffer );
            bytesEchoed += r;
          System.out.println( "Echoed "+bytesEchoed+" from "+sc );
          it.remove();
//System.out.println( "going to clear" );
//      selectedKeys.clear();
//System.out.println( "cleared" );
  static public void main( String args[] ) throws Exception {
    if (args.length<=0) {
      System.err.println( "Usage: java MultiPortEcho port [port port ...]" );
      System.exit( 1 );
    int ports[] = new int[args.length];
    for (int i=0; i<args.length; ++i) {
      ports[i] = Integer.parseInt( args[i] );
    new MultiPortEcho( ports );
}Message was edited by:
uig

You don't have to worry about OP_ACCEPT with Pipe because there are no server pipes. You already have both sides of the Pipe by construction, so just implement the OP_READ part.

Similar Messages

  • Using utl_file and unix pipes

    Hi,
    I'm trying to use utl_file and unix pipes to communicate with a unix process.
    Basically I want the unix process to read off one pipe and give me back the result on a different pipe.
    In the example below the unix process is a dummy one just copying the input to the output.
    I cant get this to work for a single plsql block writing and reading to/from the pipes - it hangs on the first read of the return pipe.
    Any ideas?
    ======== TEST CASE 1 ===============
    create directory tmp as '/tmp';
    on unix:
    cd /tmp
    mknod outpip p
    mknod inpip p
    cat < inpip > outpip
    drop table res;
    create table res (m varchar2(200));
    declare
    l_filehandle_rec UTL_FILE.file_type;
    l_filehandle_send UTL_FILE.file_type;
    l_char VARCHAR2(200);
    begin
    insert into res values ('starting');commit;
    l_filehandle_send := UTL_FILE.fopen ('TMP', 'inpip', 'A', 32000);
    insert into res values ('opened inpip ');commit;
    l_filehandle_rec := UTL_FILE.fopen ('TMP', 'outpip', 'R', 32000);
    insert into res values ('opened outpip ');commit;
    FOR i in 1..10 LOOP
    utl_file.put_line(l_filehandle_send,'line '||i);
    insert into res values ('written line '||i); commit;
    utl_file.get_line(l_filehandle_rec,l_char);
    insert into res values ('Read '||l_char);commit;
    END LOOP;
    utl_file.fclose(l_filehandle_send);
    utl_file.fclose(l_filehandle_rec);
    END;
    in a different sql session:
    select * from res:
    starting
    opened inpip
    opened outpip
    written line 1
    ============ TEST CASE 2 =================
    However If I use 2 different sql session (not what I want to do...), it works fine:
    1. unix start cat < inpip > outpip
    2. SQL session 1:
    set serveroutput on size 100000
    declare
    l_filehandle UTL_FILE.file_type;
    l_char VARCHAR2(200);
    begin
    l_filehandle := UTL_FILE.fopen ('TMP', 'outpip', 'R', 32000);
    FOR i in 1..10 LOOP
    utl_file.get_line(l_filehandle,l_char);
    dbms_output.put_line('Read '||l_char);
    END LOOP;
    utl_file.fclose(l_filehandle);
    END;
    3. SQL session 2:
    set serveroutput on size 100000
    declare
    l_filehandle UTL_FILE.file_type;
    begin
    l_filehandle := UTL_FILE.fopen ('TMP', 'inpip', 'A', 32000);
    FOR i in 1..10 LOOP
    utl_file.put_line(l_filehandle,'line '||i);
    --utl_lock.sleep(1);
    dbms_output.put_line('written line '||i);
    END LOOP;
    utl_file.fclose(l_filehandle);
    END;
    /

    > it hangs on the first read of the return pipe.
    Correct.
    A pipe is serialised I/O device. One process writes to the pipe. The write is blocked until a read (from another process or thread) is made on that pipe. Only when there is a reader for that data, the writer is unblocked and the actual write I/O occurs.
    The reverse is also true. A read on the pipe is blocked until another process/thread writes data into the pipe.
    Why? A pipe is a memory structure - not a file system file. If the write was not blocked the writer process can writes GBs of data into the pipe before a reader process starts to read that data. This will drastically knock memory consumption and performance.
    Thus the purpose of a pipe is to serve as a serialised blocking mechanism between a reader and a writer - allowing one to write data that is read by the other. With minimal memory overheads as the read must be serviced by a write and a write serviced by a read.
    If you're looking for something different, then you can open a standard file in share mode and write and read from it using two different file handles within the same process. However, the file will obviously have a file system footprint ito space (growing until the writer stops and the reader terminates and trashes the file) .
    OTOH a pipe's footprint is minimal.

  • At CRS-1,how can i use show command with pipe | ?

    HI,ALL
    when I use show command with pipe on the CRS-1,the command invalid
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line |errors 
                                                                       ^
    % Invalid input detected at '^' marker.
    ========================================================
    But Previously on the cisco 7609,I can use the show command
    GZ-DM-SR-1.MAN.7609#show int | include line |err
    Vlan1 is down, line protocol is down
         0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
         0 packets output, 0 bytes, 0 underruns
         0 output errors, 0 interface resets
    Vlan11 is administratively down, line protocol is down
         0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
         0 packets output, 0 bytes, 0 underruns
         0 output errors, 0 interface resets
    Vlan99 is down, line protocol is down
         0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored
         0 packets output, 0 bytes, 0 underruns
         0 output errors, 0 interface resets

    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line |errors 
                                                                       ^
    % Invalid input detected at '^' marker.
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line |?    

    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line | |?
                                                                        ^
    % Invalid input detected at '^' marker.
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line | ?
      begin    Begin with the line that matches
      exclude  Exclude lines that match
      file     Save the configuration
      include  Include lines that match
      utility  A set of common unix utilities
      <cr>    
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line |
    % Incomplete command.
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line |errors
                                                                       ^
    % Invalid input detected at '^' marker.
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#                                     
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line | ?   
      begin    Begin with the line that matches
      exclude  Exclude lines that match
      file     Save the configuration
      include  Include lines that match
      utility  A set of common unix utilities
      <cr>    
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line |?

    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line | include er$
    Thu Jan 15 22:36:24.120 GMT
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#
    RP/0/RP0/CPU0:JA-DL-CR-1.MAN.CRS-1#show interfaces | include line           
    Thu Jan 15 22:37:05.013 GMT
    Loopback0 is up, line protocol is up
    Loopback1 is up, line protocol is up
    Loopback6 is up, line protocol is up
    Null0 is up, line protocol is up
    POS0/0/0/0 is up, line protocol is up  (APS not Configured )
    POS0/0/1/0 is up, line protocol is up  (APS not Configured )
    TenGigE0/0/4/0 is up, line protocol is up

  • FD leaks on high load in JBOSS using Selector

    We observed FD leaks when our application is moved from Geronimo to  JBOSS. Ours is a multi-threaded application getting a response from UDP server.
    We were using Selector and DatagramChannel. we saw FD leak on high load. But when I removed Selector usage, the same does not leak any FDs.
    Is there any known issue in JDK?
    Thanks

    JBoss and Geronimo both run on top of Java.
    Obviously if you are using the same Java version for both then it is unlikely to be a JDK problem.
    If you are using a different version then there are too many variables to determine the cause.  So reduce the number of variables by using the same Java version.

  • Can I use parallel and multiplexed mode?

    Hi,
    I have
    a NI USB-6259 DAQ Module (Two Connectors with to Cables to two SCXI-1349, which connects the DAQ to the Chassis)
    a SCXI-1001 Chassis
    3 SCXI-1143 8 Channel Low Pass Filter Modules
    and
    a SCXI-1180 Front End Plate
    As the DAQ has 16 diff. AI Channels, I would like to drive two SCXI 1143 in multiplexed mode(connected to Connector 0 at USB-DAQ via SCXI 1349) and one in parallel mode assigned to AI 8-15 (Connected to Connector 1 at USB-DAQ via SCXI 1349) .
    The configuration is approved by MAX
    But when I run it with the software I get an error saying that a simultaneous scan is possible Error -223835. And that the selected channel is not in the task Error: -200486.
    Can one DAQ device(like NI USB-6259) be assigned with Channels 0-7 in multiplexed mode (multiplexing two SCXI 1143 8 Channel) and the rest of the channels in parallel mode for on SCXI card? NI-USB 6259 has to separate connectors but is it still seen as one DAQ card?
    What does the error say? I thought I configured for a simultaneous scan.
    Attached to this post is a picture:
    Top Left: Back view of my NI USB-6259
    Top Right: Front view of my chassis with three SCXI 1143
    Bottom: Back view of my chassis. Two SCXI 1249 are connected to two Cards. One card should be run in parallel mode, two in multiplexed mode.
    Cheers,
    Alex
    Solved!
    Go to Solution.

    @ Lorenz-Mie
    you are right that I need a new DAQ device, but as stated in the M-Series manual on page A-108:
    "Use Connector 0 of  your M Series device to control SCXI. NI-DAQ 7.4
    and later supports SCXI in parallel mode on Connector 1."
    Thats what I've done. I'll keep on trying.
    Alex

  • Problem using selector string in JMSn receiver

    Hi
    We are creating own JMS Queues in our code, and are using the message selector clause to distinguish between the messages.
    We are using Weblogic version 9.1.
    Although, this works when it is a standalone application (i.e when have two files to send and receive from the JMS Queue), but however the same logic fails when we integrate this with our existing code deployed on WebLogic.
    In our code, we initially receive messages from IBM MQ, before passing it onto the JMS Queue.
    On the receiver side, we use the selector clause to separate the messages.
    The code snippet is as below:
    Here we are doing the steps necessary to receive message from the weblogic queue. But we are getting exception at line createReceiver(this.queue, strQuery); The exception is in the file attached.
    ctx = getInitialContext(WEBLOGICURL);
    System.out.println("this.connectionFactoryString: \r" +
    this.connectionFactoryString);
    this.qconFactory = (QueueConnectionFactory) ctx.lookup(this.connectionFactoryString);
    System.out.println("this.qconFactory: \r" + this.qconFactory);
    this.qcon = this.qconFactory.createQueueConnection();
    System.out.println("this.qcon: \r" + this.qcon);
    this.qsession = this.qcon.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
    System.out.println("this.qsession: \r" + this.qsession);
    this.queue = (Queue) ctx.lookup(this.queueName);
    System.out.println("this.queue: \r" + this.queue);
    // Note find out whether we are getting this
    final String strQuery;
    strQuery = "JmsConductorID = '1234'";
    System.out.println(
    "strQuery in jmsReceive()of LTDSRequest.java: \r" + strQuery);
    this.qreceiver = this.qsession.createReceiver(this.queue, strQuery);
    System.out.println("Receiver created "+qreceiver);
    this.qreceiver.setMessageListener(this);
    this.qcon.start();
    javax.jms.InvalidSelectorException: weblogic.messaging.kernel.InvalidExpressionException: Expression : "JmsConductorID = '1234'"
    at weblogic.jms.dispatcher.DispatcherAdapter.convertToJMSExceptionAndThrow(DispatcherAdapter.java:110)
    at weblogic.jms.dispatcher.DispatcherAdapter.dispatchSync(DispatcherAdapter.java:45)
    at weblogic.jms.client.JMSSession.consumerCreate(JMSSession.java:2473)
    at weblogic.jms.client.JMSSession.createConsumer(JMSSession.java:2231)
    at weblogic.jms.client.JMSSession.createReceiver(JMSSession.java:2102)
    at weblogic.jms.client.WLSessionImpl.createReceiver(WLSessionImpl.java:866)
    at com.mycom.dep.myfunc.Request.init(Request.java:203)
    at com.mycom.dep.myfunc.Request.<init>(Request.java:151)
    at jrockit.reflect.NativeConstructorInvoker.newInstance([Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
          at jrockit.reflect.InitialConstructorInvoker.newInstance([Ljava.lang.Object;)Ljava.lang.Object;(Unknown Source)
          at java.lang.reflect.Constructor.newInstance([Ljava.lang.Object;I)Ljava.lang.Object;(Unknown Source)
          at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:82)
          at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:78)
          at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:156)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:683)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:621)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
          at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:245)
          at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:141)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:242)
          at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:156)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:246)
          at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:128)
          at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:324)
          at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:97)
          at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:683)
    Please can someone help?
    Regards,
    Prasad                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    In SQL*Plus you SET DEFINE OFF like this:
    SQL> set define off
    SQL> select 'S&R' from dual;
    'S&
    S&R(can't help you with Toad)

  • Browsing JMS messages using selector

    Requirement
    I want to browse for messages, using a selector.
    SENDER
    I'm sending messages in my Queue, with a property PARAMETER_ID set in it as.
    message.setStringProperty("PARAMETER_ID",param_id);
    Assume there are 4 messages sent in my Queue.
    1. Text=Message1,PARAMETER_ID=1233
    2. Text=Message2,PARAMETER_ID=4566
    3. Text=Message3,PARAMETER_ID=1233
    4. Text=Message4,PARAMETER_ID=4566
    RECEIVER
    I want to browse messages that have a certain PARAMETER_ID property set in it.
    So here's what I'll do.
    String myselector = "PARAMETER_ID=1233";
    QueueBrowser qb=session.createBrowser(queue,myselector );
    The QueueBrowser instance returned, should have 2 messages in it, that can be browsed.
    But I dont get any results and there's no exception.
    What am I doing wrong?
    btw - If I set the myselector to "", it returns me all 4 messages to browse.
    I'm using JBOSS with JMS 1.1
    Thanks

    4. Text=Message4,PARAMETER_ID=4566
    What is this ? is this msg in queue? what is
    PARAMETER_ID?that jms implementation appears to use PARAMETER_ID to identify its messages
    Header {
    jmsDestination : QUEUE.TMSQueueRemote
    jmsDeliveryMode : 2
    jmsExpiration : 0
    jmsPriority : 4
    jmsMessageID : ID:6-11824034000315
    jmsTimeStamp : 1182403400031
    jmsCorrelationID: null
    jmsReplyTo : null
    jmsType : null
    jmsRedelivered : true
    jmsProperties : {JMS_JBOSS_REDELIVERY_COUNT=1}
    jmsPropertiesReadWrite:false
    msgReadOnly : true
    producerClientId: ID:6
    Body {
    TEsf
    }MQ message implementation is different (but JMS-compliant)
    if you want to use message selectors by identifier, try jmsMessageID='123'

  • Do i use selector ??

    hi again, i have situation where i have to perform a repetitive 'case'  comparison. see below
    switch (var).
    case 1:
    [self.button1 setTitle: someText forState:UIControlStateNormal];
    case 2:
    [self.button2 setTitle: someText forState:UIControlStateNormal];
    and so on... for about 20 more cases. someText wont change either.
    is there some way of reducing this to a single command that changes at runtime ?, using sel or something like that.
    apologies if im 'barking up the wrong tree' with 'sel''. still fairly new to all this..
    still sure something can be done though!

    When creating the buttons, set the tag property to the appropriate value (whatever var becomes).
    Pseudo-code:
    UIButton *buttonFound;
    Loop through the buttons until you find the one whose tag matches the value of var.
    if (buttonFound.tag == var)
         [buttonFound setTitle: someText forState:UIControlStateNormal];

  • Java nio Pipe - Selector ptoblem

    I try to use a Pipe with a non-blocking selector,
    but the selector never selects the channel ...
    -- I do this ---
    Selector selector = SelectorProvider.provider().openSelector();
    Pipe pipe = Pipe.open();
    Pipe.SourceChannel cout = pipe.source();
    cout.configureBlocking( false );
    cout.register( selector, SelectionKey.OP_READ );
    --- and in a nother thread i do this on the Pipe( same pipe ) ---
    ByteBuffer buffin = ByteBuffer.wrap( "Testing".getBytes() );
    Pipe.SinkChannel cin = pipe.sink();
    cin.write( buffin );
    if I read from the source I can read the data but the selector never selects it ??
    /Mikael

    Interesting problem.
    This code seems to work for me:
        final Pipe pipe = Pipe.open();
        final Pipe.SourceChannel cout = pipe.source();
        final Selector s = Selector.open();
        cout.configureBlocking(false);
        cout.register(s, SelectionKey.OP_READ);
        Thread thread = new Thread(new Runnable() {
          public void run() {
            try {
            ByteBuffer buf = ByteBuffer.wrap("Testing".getBytes());
            Pipe.SinkChannel cin = pipe.sink();
            cin.write(buf);
            System.out.println("wrote");
            } catch (Exception e) {
              throw new RuntimeException(e.toString());
       thread.start();
       s.select();
       Iterator i = s.selectedKeys().iterator();
       while (i.hasNext()) {
         SelectionKey key = (SelectionKey)i.next();
         Pipe.SourceChannel out = (Pipe.SourceChannel)key.channel();
         ByteBuffer dbuf = ByteBuffer.allocate(1024);
         int read = out.read(dbuf);
         dbuf.flip();
         byte[] bbuf = new byte[read];
         dbuf.get(bbuf);
         System.out.println(new String(bbuf));
       }Is that different from your code??????
    I tested this on a Windows 2K desktop with JDK 1.4.1_01 from Sun.

  • Do transitions work if PIP is being used?

    I'm just starting to use iMovie '11 for the very first time. I've got a PIP situation where I want the main video timeline to cut using transitions while the PIP element sits bottom right, but the transitions I've placed into in the main timeline under the PIP are all greyed out and won't show when I run the timeline by hitting spacebar. Is this because you have to render the whole movie to see how those transitions will work, or do transitions not work at all while using PIP?

    Transitions will not work while using PIP.

  • Mxi includes on localhost using named pipes

    hello all,
    why does my addt "server side includes" didn't work when using localhost server using named pipes? my port is 8080 and i access the server using http//localhost:8080...
    if i access mysql query browser im using "."(a dot)as my server host.
    there is always a folder permission error but i can use php includes fine.
    can anyone help in making the "server side includes" work?

    There is no use for testing named pipes. As I said - it is an excellent method for IPC. It is slow and unscalable for networking, especially WANs.
    A few minutes of googling this subject and doing some bit of research, would highlight this quite clearly.
    BTW - if you think named pipes are better for tcp, then don't you think Oracle would have recommended its use? Heck, Oracle recommends using the RDS protocol for the RAC Interconnect. A protocol not widely known outside the HPC environment. So surely they would have sung the praises of more commonly known named pipes for tcp if it was any good?
    Which again points to the fact that it ain't good and your wasting your time by trying to be "clever" and barking up the wrong tree.

  • How can I connect using named pipes ( NMP ) ?

    Hi all,
    I'd like to do compare the availablke protocol (TCP, IPC, BEQ, NMP ) connect to my db, but I'm not able to configure named pipes.
    My *.ora files contain:
    tnsnames.ora:
    ORA10_NMP=
      (DESCRIPTION = 
        (ADDRESS =  
          (PROTOCOL = NMP)   
          (SERVER = 10.10.1.1) 
          (PIPE = ORApipe)
        (CONNECT_DATA = 
          (SID = ORA10)
    listener.ora:
    LISTENER_ORA10 =
      (DESCRIPTION_LIST =
        (DESCRIPTION =
          (ADDRESS_LIST=
            (ADDRESS =
           (PROTOCOL = TCP)
           (HOST = 10.10.1.1)
           (PORT = 1522)
            (ADDRESS =
           (PROTOCOL = IPC)
           (KEY = ORA10)
            (ADDRESS =
           (PROTOCOL = NMP)
           (SERVER = 10.0.0.1)
              (PIPE = ORApipe)
    SID_LIST_LISTENER_ORA10 =
      (SID_LIST=
        (SID_DESC=
          (SID_NAME=ORA10)               
          (ORACLE_HOME=C:\oracle\product\10.2.0\db_1)
      )The network adapter used to connect to 10.10.1.1 is a microsoft loopback adapter , and I installed the "microsoft client ".
    When I try to use the ORA10_NMP alias I always get errors like:
    C:\>c:\oracle\product\10.2.0\db_1\bin\TNSPING.EXE ORA10_NMP
    TNS Ping Utility for 32-bit Windows: Version 10.2.0.5.0 - Production on 24-JUN-2011 14:06:39
    Copyright (c) 1997,  2010, Oracle.  All rights reserved.
    Used parameter files:
    C:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = NMP) (SERVER = 10.10.1.1) (PIPE = ORApipe)) (CONNECT_DATA =
    (SID = ORA10)))
    TNS-12560: TNS:protocol adapter error
    C:\>c:\oracle\product\10.2.0\db_1\bin\sqlplus system/foo@ORA10_NMP
    SQL*Plus: Release 10.2.0.5.0 - Production on Fri Jun 24 14:06:44 2011
    Copyright (c) 1982, 2010, Oracle.  All Rights Reserved.
    ERROR:
    ORA-12560: TNS:protocol adapter error
    Enter user-name:Any suggestion?
    Thanks,
    Andrea

    There is no use for testing named pipes. As I said - it is an excellent method for IPC. It is slow and unscalable for networking, especially WANs.
    A few minutes of googling this subject and doing some bit of research, would highlight this quite clearly.
    BTW - if you think named pipes are better for tcp, then don't you think Oracle would have recommended its use? Heck, Oracle recommends using the RDS protocol for the RAC Interconnect. A protocol not widely known outside the HPC environment. So surely they would have sung the praises of more commonly known named pipes for tcp if it was any good?
    Which again points to the fact that it ain't good and your wasting your time by trying to be "clever" and barking up the wrong tree.

  • Better to install PyPI packages using pacman or pip?

    In Haskell, I ran into dependency issues when I had xmonad installed using pacman
    and other packages installed using cabal.
    Might a similar thing happen if I installed some PyPI packages (virtualenv, pymongo)
    using pacman instead of pip?
    My reason for wanting to install with pacman is that I'd be more likely to keep the
    packages up to date - they'd be tied to the rest of my system, and there's no simple
    command to upgrade all packages in pip.

    IMO, you should choose which method works best for you and stick with it.
    If you use a 3rd party package manager, you should stick with it.
    Or if you use pacman, you should stick with it.
    http://sherlock.heroku.com/blog/2012/04 … -managers/
    Towards the end I mention I don't really know much about pip and would investigate on how it works.
    But as a general rule, I would say to try out the 3rd party package manager first and see if it works.
    I would also recommend doing per user installs (install to $HOME) to keep files managed by pacman separated from files installed with the 3rd party package manager.
    Cabal and Gem imo are both superior to using packages provided in the supported repositories for the reasons outlined in my blog post.
    Hope this helps.
    Cheers!

  • Detect loss of socket connection using java.nio.channels.Selector

    I'm using the nio package to write a "proxy" type application, so I have a ServerSocketChannel listening for incoming connections from a client and then create a SocketChannel to connect to a server. Both SocketChannels are registered to the same Selector for OP_READ requests.
    All works fine, until either the client or server drops the connection. How can I detect this has happened, so my proxy app can drop the other end of the connection ?
    The Selector.select() method is not triggered by this event. I have tried using Selector.select(timeout) and then checking the status of each channel, but they still show isConnected()=true.
    Thanks,
    Phil Blake

    Please don't cross post.
    http://forum.java.sun.com/thread.jsp?thread=184411&forum=4&message=587874

  • Time Division Multiplexing and Processing Different Loops at the same time

            Hi, I am new in Labview so you may find my questions too silly, sorry about that
    I want to design an interface to control the test&measurement devices remotely. I have two desks and there are several devices on these desks. The real problem is to use two different devices at the same time. To do this I heard that I can use time division multiplexing. But I couldn't find enough information about it in Labview. Another advice I heard was to use a matrice and hold the on/off state of the devices in this matrice. 
    Where should I start the design to create such a system? Do you have any advices? Thank you in advance.
    My basic GUI is attached.
    Attachments:
    InterfaceAli.zip ‏42 KB

    As Mike pointed out you cannot communicate in parallel on the GPIB bus - unless you have separate buses for each instrument - and that defeats the purpose of a bus. I am not sure about LXI.
    With regard to your VI:
    1. Do not use global variables to pass your data around.
    2. You should use the Array data type, not the Matrix data type. The Matrix data type in LabVIEW should only be used for matrix mathematical operations (linear algebra) which cannot be easily performed on the array data type. You have many more tools in LV to work with arrays.
    3. The Event structure needs to be in a parallel loop. This is basic data flow. If you do not understand this concept, get some training, either though the online tutorials or through a class.
    4. Use Value Changed events and place the button terminals inside the event case for that control.
    5. The parallel loops need to have a Wait or some other function which causes a delay. Otherwise, the first one to start executing could consume all available processor resources. These are called "greedy loops." 
    6. Use integer data types for case structure selector inputs. Floating point values are coerced to integers at the inputs. If the values resulted from calculations, unexpected rounding effects may occur, resulting in the wrong case being selected. In some cases using type defed enums may be even better. The underlying data is integer and the enum item names show up in the case selector labels, helping to document what the case does or why it was selected.
    7. Remove the timeout case from the event structure since it never executes. Also avoid Use Default if Unwired on the terminal with your matrix (array) data. You never have a situation where an empty array is appropriate.
    Before going any further with the program questions, you need to carefully define your requirements.  How many instruments will you have? How many can be active at one time? What kinds of communication between the program and the instruments is required? This includes commands to the instrument, data returned from the instrument, error handling, and timing requirements. What will be done with the data? Display, save to file, use to automatically control another device? What safety requirements or constraints need to be met? Once you have a good requirements document, then you can begin to determine what kind of program architecture is best suited to meet the needs.
    I suspect that you may be making some things much more complicated than they need to be while ignoring other important issues.
    Lynn

Maybe you are looking for

  • After a failed disk utility fix my Macintosh hd is gone!

    I tried to do a disk utility repair on my wifes white macbook and somehow my macintosh hd has vanished. I cannot even quit and restart unless I have the disk in, which is useless.....Need Help!

  • IPod update server?

    What has happened to update server? I can't enable voiceover on my ipod shuffle.

  • What is workflow ? What are the advantages of using workflow? What are the

    what is workflow ? What are the advantages of using workflow? What are the steps for building a workflow ?

  • After Effects keeps asking for a key

    Every time I launch AE CS6 (I'm a CC member) it keeps asking for a key. This is when I select License This Software. It recognises my Adobe ID but not my subscription. I did load a trial version of AECS6 in February is this the problem? Prem pro fail

  • Delay with RSS

    I have just started using RSS... I have about 5 RSS feeds in Mail and have noticed that there is a delay from the time that the news feed is posted to to the time that it appears in Mail. For example, an item posted on the MacRumors page yesterday ev