Using two ports or Using two Input / Outputs

I'm explaining my project. It s almost done. I send message and data to server and it is stored in server. From the begining I'm using
BufferedReader - PrintWriterAnd I cannot send files because they are binary. I have to use
BufferedInputStream - BufferedOutputStreamI cannot change my input / output. So I found two solutions:
1) Connecting from another port with another socket. -> Using this it blames the ports. I cannot transfer anything from my first port.
2) Using another input / output streams from the same port. -> I didn't tried it . Does anyone tried this. Is it possible to do this.
That's the end of my project. I will give the name of project who gives me a good answer :D
Best Regards, Bulent.

I cannot change my input / output. Why not?
So I found two solutions:
1) Connecting from another port with another
er socket. -> Using this it blames the ports. I
cannot transfer anything from my first port.Huh? Unless the server stops you, there is nothing in sockets that prevents you, as a client, from connecting to the server twice.
2) Using another input / output streams from the
he same port. -> I didn't tried it . Does anyone
tried this. Is it possible to do this. Nothing stops you from using an InputStream to create two different buffered solutions.
I wouldn't even attempt this myself. It would create a very fragile application. But you could try it. You would need to carefully control when the two connections were used and in particular when they were closed. You could do this by wrapping both in a class.

Similar Messages

  • How to bind complex input/output types in web service data control

    Hi,
    I have created data control using external web service for simple input & output data type and its working fine.
    But I don't know how it can be done for complex data types.
    My external Web services have complex input & output types. Such as java object which contains another java object again it contains another java object or arry or java collection etc.
    Each my service has one complex input data type and for this no user input is require so how I can do it without using any component for it.
    I want to bind my page components with this input & output type.
    What is the best approach to do this and how to bind screen component.
    Regards,
    Devang

    Hi,
    Thanks frank.
    I already check this link before posting this so if you have any other link then kindly reply.
    Regards,
    Devang

  • Self as an input/output argument

    Hi,
    does anyone know if self is a valid argument to a method that defines its
    parameter as input/output?
    The reason I ask is that I am trying to move an application from 2.0.F.2 to
    3.0.C.0, and the TOOL compiler gives me an error that it can't find a
    method with a signature of "x" and it has methods with signatures of "x",
    "y" and "z". The only clue I have is that the compiler advises: "Check that
    any values passed to output or input output parameters are values that can
    be changed like variables or attributes."
    I might add that I personally would not be using self as an argument to
    input output parameters because of my C++ heritage. Passing "this" to a
    member function that might change the value of "this" is not a great idea!
    However, this is the code that I have to work on, warts and all, so any
    help is gratefully received.
    TIA
    Nick.
    Nick James [email protected]
    612/404-4277 or
    Consultant 414/814-3170
    BORN Information Services Group
    Volvo, Video, Velcro - I came, I saw, I stuck around.

    Just out of curiosity,
    What are some other such read-only attributes that are coming with
    R3? That way, those of us still coding in R2 will know to avoid using
    those as output parameters, and thus avoid having our code broken
    when we move to R3.
    Thanks!
    Elias.
    Claremont Technology Group, Inc.
    111 W. Liberty St., Cols, OH 43215
    (614) 628-4891
    [email protected]
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
    To: jamesn @ ns.born.com (Nick James) @ internet
    cc: forte-users @ Sagesoln.com @ internet (bcc: Elias Fayyad/Central
    Region/Claremont)
    From: dnelson @ forte.com (Don Nelson) @ INTERNET@WORLDCOM
    Date: 05/27/97 12:48:18 PM CDT
    Subject: Re: self as an input/output argument
    Nick,
    R3 does not allow you to change the value of self. It is now considered a
    read-only variable. Read-only variables may not be passed to methods using
    output parameters. R2 used to, but then the C++ compiler would, of course,
    choke on it.
    It was a convenient way to make the compiler fail if you needed to,
    though....
    Don
    >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

  • How do I program a NI 6602 card to send trigger pulses, one at each output port, triggered by an input trigger signal, using only one counter for each output port?

    Hello,
    I have managed to program a NI 6602 card in LabView to send pulses on three different output ports, one pulse on each output port (with individually chosen delays) for each input trigger pulse coming on a separate input port. It is the DAQmx Create Channel (CO-Pulse Generation-Time)-VI that I have used for this, see attached code. However, this VI controls both pulse delay and pulse width, and therefore uses two counters for each output port (although you only specify one counter in the VI input signals), as I understand.
    In my application though, I only need to have the delay chosen, the pulse width can be arbitrarily short, and thus I should only need one counter for each output port. How do I accomplish to program this in LabView?
    Best regards,
    Claes
    Attachments:
    Configure Side Camera Flash 1 Triggering.vi ‏47 KB

    Well you're welcome to do that--it will work just fine as long as you are configuring a start trigger.
    <rant>
    However, personally I really don't like putting multiple counter outputs in the same task.  I have seen so many people assume that the counter outputs would be synchronized due to having them in the same task when this is not the case (you need to configure a start trigger in order to synchronize the counter outputs even if they are in the same task).  This is the only case I can think of where multiple channels in a DAQmx task are not automatically synchronized.
    As an example:
    Running this on my PCIe X Series gives a measured 2 edge separation of 1 ms + {7.78 us - 10.11 us}.  This would likely be much worse on a bus with more latency (e.g. USB).
    The resulting output is close enough to what you might expect that it might go unnoticed, but really these counter outputs are not synchronized and it would be easy to glance at the code and not even think twice about it.  For the small amount of extra work on my end to create a separate task for each counter, it really clears up some ambiguity about what the counters are actually doing.  For me it's worth it.
    So again, for your case there really isn't a problem with having the counters in the same task since you are using an external start trigger anyway.  I have just gotten in the habit of avoiding doing this.
    </rant>
    Best Regards,
    John Passiak

  • Multi-threaded performance server using 2 ports to two-way communication

    Hi, I'm new in the forums so welcome everyone. I'm developing now an online computer game based on orginal Polish board-game, but it doesn't mean. Important is that I need to develope a high-performance multi-threaded server, which can serve... let's say few hundres of games, and a thousend of players simulateously. My server works on two ports/sockets.
    First one is represented by "ServerSocketChannel clientConSsc" in my code. The main thread in my server class which invokes the method "run()" (which You can see below), registers clientConSsc with Selector and then repeatingly accepts incoming connections from clients on this socket. When connection(channel) is estabilished and clients wants to write some request to this channel, the main thread on server creates a new instance of class "RequestHandler" which extends Thread and handles this request (reads the request from channel, makes some changes on server, spreads some new messages to other clients in the same game and so on... everything on the same socket/port/channel). Then the channel/connection is closed by the server - I call such connections: "a short connections". In the same time the main thread continues the loop and is still able to accept connections from another players. That's the idea of multi-threaded server, right? :) And to this point, everything works fine, but... what if the server wants to trigger some new command, write new information to client?
    Server could have tried to open a SocketChannel to client's IP address, but then the client programme would have to create and ServerSocketChannel object, bind it to some InetAddress and then... and then client becomes a server! - that breaks the idea of client-server cooperation and demands on players of my game to have routed some port on their machines. To resolve this problem I made some sort of "system" which, when some player/client is logging into my server, accepts second (this time constant, not "short") connection on the second port I mentoined on the beginning. This connection is held in variable "SocketChannel serverCon" of class "Player" - which reflects a player logged onto server. Server maintains every such connection till the client logs off. After the connection is accepted, the player whom connection it was is added to collection called "playersToRegisterToWrite". After the Selector.selectNow() is invoked (as You can see in the code below), each and every player's connection is registered in selector (with selection key - OP_WRITE and attachment pointing on owning player). In the same time client's code is trying to read some bytes from this connection and blocks on it until some bytes are written to this connection. When server wants to "tell" something to client, deliver some message/command, it creates a new instance of class which extends an abstract class called "ServerAction" (another new thread) and adds it to collection "actionsToDo". In ServerAction's method "run()" there are whole code to interact with client (e.g. send an update of players' list, an update of games' list, a chat message). Finnaly when Selector informs the server that some connection is writable (some client is waiting for commands), then server checks if there's any "actionToDo" involving this client/player. If there is, it unregisters the connection from Selector (so no other ServerAction (thread) can write on this connection) and starts the action. At the end of every "run()" method of subclass of ServerAction there's a code, which again adds the player to collection "playersToRegisterToWrite", so the player's connection can again be registered in Selector and the player can again receive informations from server - after it consumed THIS "ServerAction".
    It looks to me like it should be working fine, but it's not. When I test my server and clients on the same machine (no ping/latency) everything seems to be working fine. But when it comes to play my game with somebody even on LAN or through the Internet there comes the problems. My first socket I describe (and first type of connections - short connections) works perfectly fine, so the requests triggered by client are delivered and handled properly. But the second socket is cirppling. For example: the server triggers a command refering to an update of clients logged to server' list. It is triggered by Selector so the client should be ready to read data from server, so the server sends data! And the client never receives it... Why?
    It experimented a whole lot of time on SocketChannel's method "configureBlocking(boolean)", but it never helps. I think the client should always block it's listening thread on connection, contratry to server which is ment to be fast, so it should send the data through non-blocking channels. Am I right? Are there any rules refering blocking configuration of SocketChannels?
    I will be grateful for every answer. To help You out I attach also drafts from run()'s methods of my classes.
    Server's main method - main thread :
        public void run() {
           try {
                selector = Selector.open();
                clientConSsc.configureBlocking(false);
                clientConSsc.register(selector , SelectionKey.OP_ACCEPT);
                while(serverRunning) {
                    try {
                        selector.selectNow();
                        Iterator it;
                        synchronized(playersToRegisterToWrite) {
                            it = playersToRegisterToWrite.iterator();
                            while(it.hasNext()) {
                                Player player = (Player)it.next();
                                it.remove();
                                player.serverCon.configureBlocking(false);
                                player.serverCon.register(selector , SelectionKey.OP_WRITE , player);
                        Set keys = selector.selectedKeys() {
                        it = keys.iterator();
                        while(it.hasNext()) {
                            SelectionKey key = (SelectionKey)it.next();
                            if(key.isAcceptable()) {
                                it.remove();
                                clientCon = clientConSsc.accept();
                                clientCon.configureBlocking(false);
                                clientCon.register(selector , SelectionKey.OP_READ);
                                continue;
                            if(key.isReadable()) {
                                it.remove();
                                key.cancel();
                                new RequestHandler(this , (SocketChannel)key.channel()).start();
                                continue;
                            if(key.isWritable()) {
                                if(key.attachment() != null ) {
                                    ServerAction action = null;
                                    synchronized(actionsToDo) {
                                        Iterator aIt = actionsToDo.iterator();
                                        while(aIt.hasNext()) {
                                            ServerAction temp = (ServerAction)aIt.next();
                                            if(temp.getPlayer().equals((Player)key.attachment())) {
                                                action = temp;
                                                aIt.remove();
                                                break;
                                    if(action != null) {
                                        key.channel().configureBlocking(false);
                                        it.remove();
                                        key.cancel();
                                        action.start();
                                continue;
                    } catch(Exception e) {
                        statusArea.append(e.toString() + "\n");
                        e.printStackTrace();
                        continue;
            } catch(ClosedChannelException e) {
                statusArea.append(e.toString() + "\n");
            } catch(IOException e) {
                statusArea.append(e.toString() + "\n");
                A part of server's RequestHandler's class' method run() - the method which handles requests triggered by client on first port:
    public void run() {
            boolean served = false;
                try {
                    channel.configureBlocking(true);
                    retryCount++;
                    retry = false;
                    String command = ns.readText(channel).trim();
                    ns.statusArea.append("ktos przesyla komende: " + command + "\n");
                    if(command != null && !command.equals("ERROR")) {
                        String[] cmd = command.split("�");
                        ns.statusArea.append("komenda: " + cmd[0] + "\n");
                        if(cmd[0].equals("CHAT")) {
                            if(cmd.length != 5) {
                                retry();
                            } else {
                                if(cmd[2].equals("NOGAME")) {      // jezeli nie ma okreslonej gry czyli rozsylamy do wszystkich
                                    for(int i = 0 ; i < ns.loggedPlayersListItems.size() ; i++) {
                                        Player current = (Player)ns.loggedPlayersListItems.get(i);
                                        if(current.state == Player.CHOOSING && !current.equals(new Player(Integer.parseInt(cmd[1]))))   // jezeli gracz jest w okienku wybierania gry to wysylamy mu broadcast
                                            ns.actionsToDo.add(new SendMsg(ns , current , "CHAT�" + cmd[1] + "�" + cmd[3] + "�" + cmd[4]));
                                } else {
                                    Game game = (Game)ns.gamesListItems.get(ns.gamesListItems.indexOf(new Game(Integer.parseInt(cmd[2]))));
                                    for(int i = 0 ; i < game.players.size() ; i++) {
                                        Player current = (Player)game.players.get(i);
                                        if(!current.equals(new Player(Integer.parseInt(cmd[1]))))
                                            ns.actionsToDo.add(new SendMsg(ns , current , "CHAT�" + cmd[1] + "�" + cmd[3] + "�" + cmd[4]));
                                served = true;
                        } else if(cmd[0].equals("GETGAMEINFO")) {
                            if(cmd.length != 3)
                                retry();
                            else {
                                int gameID = Integer.parseInt(cmd[2]);
                                ns.statusArea.append("poproszono o informacje o grze nr: " + gameID + "\n");
                                Game checkedGame = new Game(gameID);
                                if(ns.gamesListItems.contains(checkedGame)) {
                                    Game game = (Game)ns.gamesListItems.get(ns.gamesListItems.indexOf(checkedGame));
                                    channel.configureBlocking(true);
                                    ObjectOutputStream oos = new ObjectOutputStream(channel.socket().getOutputStream());
                                    oos.writeObject(game);
                                    oos.writeObject(game.players);
                                    oos.flush();
                                    ns.statusArea.append("wyslano informacje o grze nr: " + gameID + "\n");
                                } else {
                                    ns.statusArea.append("brak gry o nr: " + gameID + "\n");
                                served = true;
                } catch(IOException e) {
                    e.printStackTrace();
            if(!served) {
                ns.findAndDisconnectPlayer(channel);
            try {
                channel.close();
            } catch(IOException e) {
                e.printStackTrace();
        }An example of ServerAction's subclass - the class which triggers server commands to client on second port:
    class UpdateLoggedPlayersList extends ServerAction {
        public UpdateLoggedPlayersList(NeuroServer ns , Player player) {
            super(ns , player);
        public void run() {
            try {
                serverCon.configureBlocking(true);
                ns.sendText("UPDATELOGGEDPLAYERSLIST" , serverCon);
                if(ns.readText(serverCon).equals("OK")) {
                    ObjectOutputStream oos = new ObjectOutputStream(serverCon.socket().getOutputStream());
                    oos.writeObject(ns.loggedPlayersListItems);
                    oos.flush();
                synchronized(ns.playersToRegisterToWrite) {
                     ns.playersToRegisterToWrite.add(player);
            } catch(IOException e) {
                e.printStackTrace();
    }A part of client's CmdHandler's class' method run() - the method which handles commands triggered by server:
    public void run() {
        try {
            while(works) {
                String command = nc.readText(nc.serverCon);
                System.out.println("Server przesyla komende: " + command + "\n");
                String[] cmd = command.split("�");
                if(cmd[0] != null && !cmd[0].equals("ERROR")) {
                    if(cmd[0].equals("CHAT")) {
                        if(nc.chooseGameDialog != null && nc.chooseGameDialog.isVisible()) {     // jezeli na wybieraniu gry
                            newChatEntry(cmd[2] , null , cmd[3] , nc.chooseGameDialog.chatPane);
                        } else if(nc.readyDialog != null && nc.readyDialog.isVisible()) {  // jesli na przygotowywaniu
                            Player sender = (Player)nc.actGame.players.get(nc.actGame.players.indexOf(new Player(Integer.parseInt(cmd[1]))));
                            newChatEntry(cmd[2] , sender.fraction , cmd[3] , nc.readyDialog.chatPane);
                        } else if(nc.ng != null) {                   // jesli w grze
                            Player sender = (Player)nc.actGame.players.get(nc.actGame.players.indexOf(new Player(Integer.parseInt(cmd[1]))));
                            newChatEntry(cmd[2] , sender.fraction , cmd[3] , nc.ng.inGameChatPane);
                    } else if(cmd[0].equals("UPDATELOGGEDPLAYERSLIST")) {
                        nc.sendText("OK" , nc.serverCon , false);
                        nc.serverCon.configureBlocking(true);
                        ObjectInputStream ois = new ObjectInputStream(nc.serverCon.socket().getInputStream());
                        DefaultListModel players = (DefaultListModel)ois.readObject();
                        nc.chooseGameDialog.updateLoggedPlayersList(players);
        } catch(IndexOutOfBoundsException e) {
            System.out.println(e);
        } catch(IOException e) {
            System.out.println(e);
        } catch(ClassNotFoundException e) {
            System.out.println(e);
    }And two methods I used in codes above: sendText(String text , SocketChannel sc) and readText(SocketChannel sc) - they are my "utility" methods, which I use to send and receive Strings through specified SocketChannels.
    boolean sendText(String text , SocketChannel sc) {
        ByteBuffer bbuf = ByteBuffer.allocate(BSIZE);
        boolean sendRetry;
        boolean sent = false;
        do {
            sendRetry = false;
            try {
                StringBuffer cmd = new StringBuffer();
                cmd.setLength(0);
                if(text.length()+4 < 100)
                    cmd.append("0");
                if(text.length()+4 < 10)
                    cmd.append("0");
                cmd.append(Integer.toString(text.length()+4) + "�");
                cmd.append(text);
                cmd.append("\n");
                bbuf = charset.encode(CharBuffer.wrap(cmd));
                sc.write(bbuf);
                bbuf.clear();
                int n = sc.read(bbuf);
                if(n == 1) {
                    bbuf.flip();
                    Byte re = bbuf.get();
                    if(re == 1) {
                        sendRetry = true;
                    } else {
                        sent = true;
            } catch(Exception e) {
                findAndDisconnectPlayer(sc);
                try {
                    sc.close();
                } catch(IOException f) {
                    f.printStackTrace();
                return false;
        } while(!sent && sendRetry);
        return true;
    String readText(SocketChannel sc) {
        ByteBuffer bbuf = ByteBuffer.allocate(BSIZE);
        int readRetryCount = -1;
        boolean readRetry;
        do {
            readRetry = false;
            readRetryCount++;
            StringBuffer cmd = new StringBuffer();
            cmd.setLength(0);
            bbuf.clear();
            try {
                readLoop:
                while(true) {
                    int n = sc.read(bbuf);
                    if(n > 0) {
                        bbuf.flip();
                        CharBuffer cbuf = charset.decode(bbuf);
                        while(cbuf.hasRemaining()) {
                            char c = cbuf.get();
                            if(c == '\r' || c == '\n') break readLoop;
                            cmd.append(c);
                    } else break;
                statusArea.append(Thread.currentThread().getId() + " readText() odczytuje: " + cmd.toString() + "\n");
                if(cmd.length() < 3 || Integer.parseInt(cmd.substring(0 , 3)) != cmd.length()) {
                    sc.write(ByteBuffer.wrap(new byte[] {1}));
                    readRetry = true;
                } else {
                    sc.write(ByteBuffer.wrap(new byte[] {0}));    // length OK
                    return cmd.toString().substring(4 , cmd.toString().length());
            } catch(Exception e) {
                findAndDisconnectPlayer(sc);
                try {
                    sc.close();
                } catch(IOException f) {
                    f.printStackTrace();
                return "ERROR";
        } while(readRetry && readRetryCount < 3);
        findAndDisconnectPlayer(sc);
        try {
            sc.close();
        } catch(IOException e) {
            e.printStackTrace();
        return "ERROR";
    }Edited by: Kakalec on Jul 23, 2008 11:04 AM

    You seem to be using a horrendous mixture of PrintWriters, BufferedReaders, ObjectOutputStreams, and no doubt ObjectInputStreams. You can't do that.
    Some rules about this:
    (a) Whenever you use a stream or reader or writer on a socket, you must allocate it once for the life of the socket, not every time you want to do an I/O.
    There are many reasons for this including losing buffered data in the old stream and auto-closure of the socket on garbage-collection of the old stream.
    (b) You can't mix stream types on the same socket. (i) If you're writing objects, use an ObjectOutputStream, you must read with an ObjectInputStream, and you can't read or write anything that isn't supported by the API of ObjectOutputStream. (ii) If you're writing lines, use a BufferedWriter and a BufferedReader at the other end. If you're writing characters, use a Writer and a Reader. (iii) If you're writing primitive data or UTF strings, use a DataOutputStream and a DataInputStream. (iv) If you're writing bytes, use DataOutputStream and a DataInputStream or an OutputStream and an InputStream. You can't mix (i), (ii), (iii), and (iv).
    (c) Don't use PrintWriter or PrintStream over the network. They swallow exceptions that you need to know about. They are for writing to the console, or log files, where you don't really care about exceptions.
    (d) Call flush() before reading.
    (e) Always close the 'outermost' output stream or writer of a socket, never the input stream or the socket itself. Closing any of these closes the socket and therefore makes the other stream unusable, but only closing the output stream/writer will flush it.

  • Static NAT to two servers using same port

    I have a small office network with a single public IP address. Currently we have a static nat for port 443 for the VPN. We just received new software that requires the server the software is on to be listening on port 443 across the internet. Thus, essentially I need to do natting (port forwarding) using port 443 to two different servers.
    I believe that the usual way to accomplish this would be to have the second natting use a different public facing port, natted to 443 on the inside of the network (like using port 80 and 8080 for http). But, if the software company says that it must use port 443, is there any other way to go about this? If, for example, I know the IP address that the remote server will be connecting to our local server on, is there any way to add the source IP address into the rule? Could it work like, any port 443 traffic also from x.x.x.x, forward to local machine 192.168.0.2. Forward all other port 443 traffic not from x.x.x.x to 192.168.0.3.
    Any help would be very much appreciated.
    Thanks,
    - Mike                  

    Hi,
    Using the same public/mapped port on software levels 8.2 and below would be impossible. Only one rule could apply. I think the Cisco FWSM accepts the second command while the ASA to my understanding simply rejects the second "static" statement with ERROR messages.
    On the software levels 8.3 and above you have a chance to build a rule for the same public/mapped port WHEN you know where the connections to the other overlapping public/mapped port is coming from. This usually is not the case for public services but in your situation I gather you know the source address where connections to this server are going to come from?
    I have not used this in production and would not wish to do so. I have only done a simple test in the past for a CSC user. I tested mapping port TCP/5900 for VNC twice while defining the source addresses the connections would be coming from in the "nat" configuration (8.4 software) and it seemed to work. I am not all that certain is this a stable solution. I would imagine it could not be recomended for a production environment setup.
    But nevertheless its a possibility.
    So you would need the newer software on your firewall but I am not sure what devce you are using and what software its using.
    - Jouni

  • How can I use two ports in the same time?

    My application need one pc use two ports the same time.But when I open one port and my systerm is running the other port can't be opened.
    I use the frame API in VC++6.0.
    My OS is win2000 server;
    The functions I used are ncOpenObject();

    Hi DickW
    Thank you for your help!
    I have tried the example.But the example shows how to connect one CAN network with two ports.
    I want each port connect to the net can both read and write;
    I want to apply the function like this:
    1.config the port1 and port2
    2,open port1 and port2
    But after I open port1 or port2 the other port can't be opened;
    After I open the second port it always returns negative.
    In the codes I use CAN0 and CAN1 as the CAN objects.
    Attachments:
    twoport.zip ‏1184 KB

  • How to set up NAT for two servers using same port with ASDM ASA 5505

    Hi there,
    We have a new installation of a ASA 5505 and are trying to get some NAT issues straightened out. Here is the scenario: On our internal network, we have two servers running Filemaker Server, a relational database server that clients connect with using port 5003. Our goal is to be able to allow users from the outside to access either of these servers as needed. I know how to set up a simple static NAT rule and matching Access rule in ASDM which would be fine for a case in which only one server using a given port is running on a network, but for simple static rules I seem to be blocked from entering a different translated port number from the orginal port number, which becomes a problem when two servers we need to access from the outside are running software using the same port number.
    What is the simplest way to address this need? I am guessing that I need to set up a scenario like this, where port 5004 (or any arbitrarily choosen unused port, can be used to access the second server:
    Outside user enters   FQDN:5004  and this translates to Database server # 1 as   192.168.1.40:5003
    and
    Outside user enters   FQDN:5003  and this translates to Database server # 1 as   192.168.1.38:5003
    If so, what is the easist way to get this done? Or is there a better what to handle this scenario?
    Thanks in advance,
    James

    I would create two objects and use object NAT
    object network Obj_5004
    host 192.168.1.40
    object network Obj_5004
    nat (inside,outside) static service tcp 5003 5004
    object network Obj_5003
    host 192.168.1.38
    object network Obj_5003
    nat (inside,outside) static service tcp 5003 5003
    Of course you will need to open your outside interface for tcp ports 5003 and 5004 to make this happen

  • Create a two-way link (using AppleScript?) in Numbers '09

    We are migrating to iWork '09 for our business needs and seek an Applescript expert to advise us as follows.
    Our team has successfully used VBA in Excel for Mac 2004 to "two-way link" two cells in differing spreadsheets such that anything entered in cell 1 shows up in cell 2 and vice versa. However, neither Excel for Mac 2008 (which most of our company uses) nor Numbers supports VBA, and Numbers seems like the best overall app to use IF we can get two cells to link as described. Typical formulas do not work as a cell cannot be both an input and an output cell.
    Please advise or help!
    Thank you,
    Reos Partners

    yuleth wrote:
    Thank you Yvan. We are grateful for your lengthy response and your suggested script. There are a few things to clarify before we can take a next step with that script.
    1. We are planning to have not just two documents, but many documents. When we share these Numbers documents on a network drive or Dropbox, the entire setup will become a project management tool. We will have a "master" document as well as "project-specific" documents in this setup, all linked together by the script or scripts in question and housed in different folders.
    I really dislike working with documents stored on a network.
    It's more safe to work with a local file and store it on the network when it's OK.
    The "master" document will allow the general manager to see and enter data that shows up in "project-specific" documents. On the other hand, data entered in specific cells in the "project-specific" documents will show up in the manager's "master."
    If I understand well,
    rangeA of cells of the 'master' doc are shared with document A
    rangeB of cells of the 'master' doc are shared with document B
    rangeZ of cells of the 'master' doc are shared with document Z
    as well as
    rangeA of cells of document A are shared with the 'master' doc
    rangeB of cells of the document B are shared with the 'master' doc
    rangeZ of cells of the document Z are shared with the 'master' doc
    It's important that this functionality operate not only with open documents; this should be able to function also when only one of the linked documents, master or otherwise, is in use. Is that possible?
    It would require that the script is aware of the exact location of every document.
    2. We understand the limitation you describe: either a predefined (hardcoded) cell in the script OR the same location in the target document.
    3. Once we have a script that performs as described above, we actually don't know what to do with it: we're brand new to Applescript but have used Macs for many years. Given our unfamiliarity with the use of such scripts, please advise, or point us to a resource: then what? How is such a script applied to a Numbers document or a series of documents? Or do we set it up such that it always runs when Numbers runs, and if so, how? What is the procedure?
    Using a script running in the background would not be safe to capture cells selection.
    I thought that I was clear when I wrote:
    +Given two open documents whose names are defined by the property theDocs,+
    +enter a value in a cell on one of them.+
    +With the cell selected, call the script.+
    +It will copy the entered value in the same cell of the other document.+
    In the original script, when one script is filled and selected,
    it's your duty to call the script.
    --[SCRIPT]
    The embedded properties describe a master document
    and several subscriber documents.
    One describe the ranges of cells dedicated to each subscriber.
    These ranges are of this format: {topRow, leftColumn, bottomRow, rightColumn}
    In the open document, fill the range of cells dedicated to one document.
    Select this range.
    Call the script.
    It will copy the selected range in the same range of the target document.
    Yvan KOENIG (Vallauris, FRANCE)
    2009/07/31
    enhanced 2009/08/01
    property masterName : "masterDoc.numbers"
    property masterContainer : "Macintosh HD:Users:yvan_koenig:Desktop:"
    property theNames : {"documentA.numbers", "documentB.numbers"}
    property theContainers : {"Macintosh HD:Users:yvan_koenig:Desktop:", "Macintosh HD:Users:yvan_koenig:Desktop:"}
    property theRanges : {{2, 2, 4, 3}, {5, 4, 8, 5}}
    --=====
    on run
    set {dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
    if (dName is not masterName) and (dName is not in theNames) then error "the source document is not an allowed one !"
    if dName is masterName then (*
    the selection is in the master document
    we must define the target document *)
    set theRange to {rowNum1, colNum1, rowNum2, colNum2}
    set maybe to false
    repeat with i from 1 to count of theRanges
    if theRange is item i of theRanges then (*
    the selected range is one of the predefined ones so we may define the parameters of the target document *)
    set targetname to item i of theNames
    set targetContainer to item i of theContainers
    set maybe to true
    exit repeat
    end if
    end repeat
    if maybe is false then error "the selection in the document “" & dName & "” is not valid !"
    else (*
    the selection is in one of the subscriber documents.
    So the target document is the master one. *)
    set targetname to masterName
    set targetContainer to masterContainer
    (* now, we must grab the predefined range linked to the active document *)
    repeat with i from 1 to count of theNames
    if dName is item i of theNames then
    set theRange to item i of theRanges
    exit repeat
    end if
    end repeat
    (* we check that the selected range is really the predefined one *)
    if {rowNum1, colNum1, rowNum2, colNum2} is not theRange then error "the selection in the document “" & dName & "” is not valid !"
    end if
    (* Here we know the name of the target document
    the container of the target document
    the selected range
    tell application "Numbers"
    set isOpen to targetname is in (get name of documents)
    if not isOpen then
    open file (targetContainer & targetname)
    repeat
    if (get name of documents) contains targetname then exit repeat
    end repeat
    end if
    repeat with r from item 1 of theRange to item 3 of theRange
    repeat with c from item 2 of theRange to item 4 of theRange
    tell document dName to tell sheet sName to tell table tName to set theValue to value of cell r of column c
    tell document targetname to tell sheet sName to tell table tName to set value of cell r of column c to theValue
    end repeat -- columns
    end repeat -- rows
    save document targetname
    if not isOpen then close document targetname
    end tell -- Numbers
    end run
    --=====
    set { dName, sName, tName, rname, rowNum1, colNum1, rowNum2, colNum2} to my getSelParams()
    on getSelParams()
    local r_Name, t_Name, s_Name, d_Name, col_Num1, row_Num1, col_Num2, row_Num2
    set {d_Name, s_Name, t_Name, r_Name} to my getSelection()
    if r_Name is missing value then
    if my parleAnglais() then
    error "No selected cells"
    else
    error "Il n'y a pas de cellule sélectionnée !"
    end if
    end if
    set two_Names to my decoupe(r_Name, ":")
    set {row_Num1, col_Num1} to my decipher(item 1 of two_Names, d_Name, s_Name, t_Name)
    if item 2 of two_Names = item 1 of two_Names then
    set {row_Num2, col_Num2} to {row_Num1, col_Num1}
    else
    set {row_Num2, col_Num2} to my decipher(item 2 of two_Names, d_Name, s_Name, t_Name)
    end if
    return {d_Name, s_Name, t_Name, r_Name, row_Num1, col_Num1, row_Num2, col_Num2}
    end getSelParams
    --=====
    set {rowNumber, columnNumber} to my decipher(cellRef,docName,sheetName,tableName)
    apply to named row or named column !
    on decipher(n, d, s, t)
    tell application "Numbers" to tell document d to tell sheet s to tell table t to return {address of row of cell n, address of column of cell n}
    end decipher
    --=====
    set { d_Name, s_Name, t_Name, r_Name} to my getSelection()
    on getSelection()
    local _, theRange, theTable, theSheet, theDoc, errMsg, errNum
    tell application "Numbers" to tell document 1
    repeat with i from 1 to the count of sheets
    tell sheet i
    set x to the count of tables
    if x > 0 then
    repeat with y from 1 to x
    try
    (selection range of table y) as text
    on error errMsg number errNum
    set {_, theRange, _, theTable, _, theSheet, _, theDoc} to my decoupe(errMsg, quote)
    return {theDoc, theSheet, theTable, theRange}
    end try
    end repeat -- y
    end if -- x>0
    end tell -- sheet
    end repeat -- i
    end tell -- document
    return {missing value, missing value, missing value, missing value}
    end getSelection
    --=====
    on decoupe(t, d)
    local l
    set AppleScript's text item delimiters to d
    set l to text items of t
    set AppleScript's text item delimiters to ""
    return l
    end decoupe
    --=====
    on parleAnglais()
    local z
    try
    tell application "Numbers09English" to set z to localized string "Cancel"
    on error
    set z to "Cancel"
    end try
    return (z is not "Annuler")
    end parleAnglais
    --=====
    --[/SCRIPT]
    Yvan KOENIG (from FRANCE samedi 1 août 2009 17:57:05)

  • Help with Input/Output Parameter Size using OLE DB Provider

    I am using the OLE DB Provider for 9i in an Active Server Page to call a stored procedure in a 9i database. I pass have an input/output parameter (adVarChar with adSize=30) in which I pass a two digit number in, and expect to get a character value greater than 2 characters in return. However, when I execute the stored procedure call, it appears the value being returned in the parameter is being truncated to the size of the value I passed in (2 characters). Is there a way I can insure the parameter will return the entire length of the result regardless of the length of the input value?

    cmd.Parameters.Add("retstatus", OracleDbType.Varchar2, 200, ParameterDirection.InputOutput); It seems to me that you're trying to use an OracleParameter constructor with parameter name, parameter type, parameter SIZE, and parameter direction. But OracleParameter class does not have any such constructor. Therefore, your test tries to use another constructor incorrectly.
    OracleParameter has two constructors with four parameter ...
    public OracleParameter(string parameterName, OracleDbType type, object obj, ParameterDirection direction)
    public OracleParameter(string parameterName, OracleDbType type, int size, string srcColumn)
    ... and none of these matches your constructor. One way to solve this problem is to use appropriate constructor or OracleParameter properties.

  • Can't select input output and name media when using MRC1 log and transfer

    I am using a MRC1 from the Sony Z5E to film my media. I downloaded the plugin which allows me to log and transfer through FCP 6.0.6. The only problem is that it does not allow me to input/output and name the pieces of each clip that I want. Hence I can only import the whole clip and am wasting time and space with media that I do not want or need. Is there an additional plugin or setting to pick on FCP to get this feature to work?
    Rich

    Hi xhk, I'm a Kubuntu's user and I've had the same problems. I've been days reading on the Internet about this issue and finally I solve it by following this post from a Spanish tutorial: http://bit.ly/4p3XFq. It worked for me!
    Basically it is:
    1. Get install the needed packages, i.e: sudo apt-get install ibus ibus-pinyin
    2. After installing them, introduce a little code into two files:
    2.1.--> type on your konsole: kate /home/$(whoami)/.bashrc
       a--> add to the bottom of the opened text:
    export GTK_IM_MODULE=ibus
    export XMODIFIERS=@im=ibus
    export QT_IM_MODULE=ibus
       b-->save the changes on the text.
    2.2.--> type again on your konsole: kate /home/$(whoami)/.profile
      b--> repeat 2.1.a. and 2.1.b
    3. Go to main menu - system settings - advance - "autoarranque" (I don't know how it is called in English, "restarting" maybe?) and then "add a programme". Type: ibus-daemon -d, press OK and then rebooth.
    It shall be working by then.
    Last edited by mxd (2013-07-06 01:42:27)

  • Using Counters as Input & Output simultaneously

    Hello All,
    I am using PCI 6221 (68 pin), I am using one of the counters as inputting pulses to a servo, can I use the other counter "Counter 2" for counting thoses pulses which I am generating from "Counter 1", also I want to make it synchronized.
    As soon as I generate pulses my reading counter should start, anyone help me with some example.
    Using LV 8.0
    Thanks

    Hello James,
    If you are outputting a continuous pulse train then you should be able to use the second counter to read them back in.  If you're doing a finite generation to the servo motor then that task is actually using both counters (one counter gates the other:  How Many Counters Does Each Type of Counter Input or Output Task Take?).  Assuming that you do have an available counter then you can run any of the single counter input tasks listed in the above KnowledgeBase article.  There are a number of counter input task examples in the LabVIEW Example Finder that you can access by opening LabVIEW and going to Help» Find Examples...  Then navigate to Hardware Input and Output» DAQmx» Counter Measurements.  From there you'll need to find the example for whatever type of measurement you want to do.
    Synchronization is a different issue.  In general synchronization requires that two tasks start at the same time and share a timebase.  In this case, you can start the counter input task first since it will be waiting on the counter output to start measurements.  Then, if you do a buffered counter input measurement (see example finder--you'll need to set up an implicit sample clock), you'll get exactly one counter input measurement for each period of the counter output.  This happens because for frequency/period/pulse width the counter latches one value on each rising or falling edge so the measurements are automatically synced.
    I hope this helps, and have a great day!
    Brooks

  • T410 + Ubuntu Lucid: Two Weeks of Use (the Good, the Bad, the Ugly)

    System 
    Lenovo ThinkPad T410 laptop, Integrated Intel Graphics, Intel Centrino Advanced-N 6200 wireless.
    Fixed
    Resume did not work after second suspend. Fixed by updating BIOS. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/532374
    Font antialiasing misconfiguration that made small fonts look bad; had to edit ~/.fonts.conf manually to defeat the system preventing antialiasing at small font sizes. Screen is small (14") but has very high resolution (1440x900), so this seems to work ok here.
    Evolution doesn't autocomplete the email addresses of people you communicate with regularly. Fixed: turn on automatic contacts and autocomplete.
    Printer config didn't work til I changed system-config-printer to not use the Python on the user path: https://bugs.launchpad.net/ubuntu/+source/system-config-printer/+bug/328657
    Emacs copy/cut (meta-W, ctrl-W) doesn't put the text being operated on into the X clipboard. Likewise, putting something into the X clipboard doesn't make it possible to paste it into Emacs via ctrl-Y. Fixed via:
    (global-set-key "\C-w" 'clipboard-kill-region)
    (global-set-key "\M-w" 'clipboard-kill-ring-save)
    (global-set-key "\C-y" 'clipboard-yank)
    See also http://www.emacswiki.org/emacs/CopyAndPaste#toc2
    Toggle state of hardware mute button and software mute button not synchronized. If you hit the hardware mute button, it lights. If you subsequently unmute via software, the sound is umuted, but the hardware mute button remains lit. Pressing the lit hardware mute button in that state will result in the hardware mute button becoming unlit but the sound muted. Seems to have gotten fixed in upgrade to 2.6.34-999-generic kernel while trying to fix USB resume issue.
    USB broken after resume: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/566149 . (Installed http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/2010-05-06-lucid/ aka kernel version 2.6.34-999-generic as per the instructions in https://wiki.ubuntu.com/KernelTeam/MainlineBuilds while waiting for "official" kernel update from Ubuntu).
    Outstanding
    Sometimes Bluetooth icon in indicator applet shows a red X next to it, sometimes it doesn't. I haven't bothered with Bluetooth yet, so I don't know why it's changing state.
    Sometimes audio mute button stops working. What's in syslog: keyboard.c: can't emulate rawmode for keycode 240 for each button press. Not sure why it works sometimes and not others.
    HDMI audio probably busted with installation of http://kernel.ubuntu.com/~kernel-ppa/mainline/daily/2010-05-06-lucid/ to fix https://bugs.launchpad.net/ubuntu/+source/linux/+bug/5661492. KDE came up and warned me the device had disappeared when I rebooted with the new kernel.
    Complete system lockups at various points (maybe once every couple days) requiring a hard power reset. I haven't been able to distinguish a pattern yet. Might be related to the wireless errors below; someone else claimed that a similar wireless card got hot enough under Linux to cause disconnects and weird system behavior. I haven't seen crazy temperatures yet though.
    Wireless network card (Intel Centrino Advanced-N 6200, using the iwlagn driver) freaks out every 20 minutes or so and "restarts" (whatever that means). Seems to be a firmware problem. Symptom: Microcode SW error detected.  Restarting 0x2000000. in syslog. sudo iwconfig wlan0 power off doesn't fix it, upgrade to 2.6.34.99 kernel didn't fix it, can't seem to find any newer firmware to try than what's in http://intellinuxwireless.org/iwlwifi/downloads/iwlwifi-6000-ucode-9.193.4.1.tgz. Reported bug at http://bugzilla.intellinuxwireless.org/show_bug.cgi?id=2205 as per http://www.intellinuxwireless.org/?n=fw_error_report
    Some potentially related Ubuntu info: http://ubuntuforums.org/archive/index.php/t-1142917.html
    WTF in syslog, every so often: wpa_supplicant[1196]: CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys plus about 10 other lines of gibberish. Probably related to the microcode problem above, no use trying to figure it out until that gets fixed. See also https://bugs.launchpad.net/ubuntu/+source/linux/+bug/548992
    At boot time, xdpyinfo | grep resolution still reports wrong DPI (reported: 96x96; actual: 120x120) and screen size (reported: 381x238mm; actual: 300x190mm) even after generating an xorg.conf and adding a DisplaySize 300 190 to the single Section "Monitor" in the config. This doesn't seem to be harming anything, but I don't know really what uses this info. Using xrandr -dpi 120 fixes the resolution and screen size reported by xdpyinfo.
    Firefox is a problem child for display at 120DPI (native screen DPI); some fonts are huge or tiny when they shouldn't be. Setting the layout.css.dpi in about:config to 120 seems to have no effect. This makes Firefox unusable for me on this system. Thankfully, Google Chrome doesn't have the same problem.
    Fingerprint reader unsupported.
    When bringing up a backgrounded Emacs window, sometimes Emacs refuses to give me control of the point in that window until I sacrifice the chicken of selecting any item from that window's menu bar.
    Emacs acts upon first click of any frame; clicking in a background emacs window reposititions the point in that window. I tried to fix this by adding (setq x-mouse-click-focus-ignore-position t) to my .emacs file as per http://www.gnu.org/software/emacs/manual/html_node/emacs/Mouse-Commands.html. This actually solved the problem: the first click of a window no longer repositioned the point. Unfortunately, contrary to the docs and contrary to the experience of somebody else in #emacs on freenode IRC, this setting also makes the mouse useless for selecting text, moving the point, or scrolling the window text in emacs. It just won't do any of those things for me anymore when this option is set. I can't even shift click on a window to set the font size. This symptom is worse than the problem I was trying to solve by doing it, so I left it off.
    Audio CD burning doesn't work from Rhythmbox: https://bugs.launchpad.net/ubuntu/lucid/+source/brasero/+bug/543892
    Pulse Audio advertises airport express send capability; it doesn't actually work (very choppy playback, unlistenable). http://pulseaudio.org/ticket/495#comment:23
    Opening Rhythmbox from the applications menu doesn't actually open the main window, it just creates a toolbar icon. You then need to know enough to go click on "Show Rhythmbox" in the toolbar icon dropdown.
    Konversation: sometimes the mouse pointer "disappears" while hovering over the nick list and the channel list. Only fixed by a restart of Konversation (closing the window and restoring it from the system tray doesn't help).
    Cut and paste is, as always, horrific. You need to use Shift-Ctrl-C in the Gnome terminal vs. Ctrl-C in other Gnome apps; Emacs meta-W doesn't put things onto the X clipboard by default, etc. I really don't understand why you can't remap cut copy and paste under Gnome. If you could remap the Gnome keybindings for cut, paste, copy, etc, I'd bind copy to Windowskey-C, paste to Windowskey-V, cut to Windowskey-X, and Undo to Windowskey-Z. Then at least for all Gnome apps that followed the system keybindings, most of the pain would disappear, because the cutnpaste shortcuts wouldn't step on alternate meanings.
    Still doesn't look quite as nice as the Mac does, dispite newer and better video and display hardware, no matter how many hours I spend messing around with display settings, font settings, etc.

    Not sure how you figure it's an "advanced router" problem.  I'd be happy to buy a different router, but I'd need to be told which one to buy. The router I'm connecting to is a barebones Linksys WRT54G (the blue and black one with the two antennas that you see everywhere).  These routers are maybe the most common router on the planet, AFAICT.
    I have also seen Compiz lockups, but I didn't mention those in the above; the lockups I'm seeing are true system lockups.  The system stops responding to any input on network, so it cannot even be restarted remotely.

  • Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    Hi, I have small problem, for some time in music area I had two folders to use 1. Apple loops for soundtrack pro 2. Final Cut pro sound effects now both are gray and with out content may I know what happend

    I just went through this and it appears that my Focusrite Saffire was the culprit. I connected all the outputs on the focusrite according to the way the jacsk on the back were labeled and then set up the multichannel speaker setup to match. Then I went into STP, created a pink noise clip and panned it around, the LFE, center and rears were not in the right place.
    I reconnected the hardware to match the 5.1 pan pot in STP then changed the multichannel speaker setup to match. Everything appears to be correct now but I would have loved to have been able to just assigned the output busses to correct outputs in the saffire.
    Next step is to pan that pink noise around with my SPL meter to calibrate the room.

  • How to prevent Oracle from using an index when joining two tables ...

    How to prevent Oracle from using an index when joining two tables to get an inline view which is used in an update statement?
    O.K. I think I have to explain what I mean:
    When joining two tables which have many entries sometimes it es better not to use an index on the column used as join criteria.
    I have two tables: table A and table B.
    Table A has 4.000.000 entries and table B has 700.000 entries.
    I have a join of both tables with a numeric column as join criteria.
    There is an index on this column in table A.
    So I instead of
      where (A.col = B.col)I want to use
      where (A.col+0 = B.col)in order to prevent Oracle from using the index.
    When I use the join in a select statement it works.
    But when I use the join as inline view in an update statement I get the error ORA-01779.
    When I remove the "+0" the update statement works. (The column col is unique in table B).
    Any ideas why this happens?
    Thank you very much in advance for any help.
    Regards Hartmut

    I think you should post an properly formatted explain plan output using DBMS_XPLAN.DISPLAY including the "Predicate Information" section below the plan to provide more details regarding your query resp. update statement. Please use the \[code\] and \[code\] tags to enhance readability of the output provided:
    In SQL*Plus:
    SET LINESIZE 130
    EXPLAIN PLAN FOR <your statement>;
    SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY);Usually if you're using the CBO (cost based optimizer) and have reasonable statistics gathered on the database objects used the optimizer should be able to determine if it is better to use the existing index or not.
    Things look different if you don't have statistics, you have outdated/wrong statistics or deliberately still use the RBO (rule based optimizer). In this case you would have to use other means to prevent the index usage, the most obvious would be the already mentioned NO_INDEX or FULL hint.
    But I strongly recommend to check in first place why the optimizer apparently seems to choose an inappropriate index access path.
    Regards,
    Randolf
    Oracle related stuff:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle:
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

Maybe you are looking for

  • In PLDs,How do u get Bank Name from Bank code displayed in Payment means

    Hello Experts Have an issues with getting bank name which is displayed in the payment means when designing an PLD and viewed in print previews i tried but i got the code of the bank name but iam not able to get the bank name please help me out in thi

  • Best practice for a new wordpress install / dreamweaver

    One thing that is being shown in the demo video's.  A pre created wordpress document, I wish, they started to show with a new wordpress install / setting up the server etc.  What are the best practices with using a service which has a one button word

  • 404 error while accessing sicf services via apache reverse proxy

    Hi, I set up an reverse proxy with apache 2.2 and try to access SICF Services via this proxy. I got the following error message from the sap system: Service cannot be reached The termination occurred in system SMP with error code 404 and for the reas

  • The application "Installer" has quit unexpectedly"

    Am running 10.5.8 on a PPC dual 2.0 Ghz G5 tower, with 8 GB RAM. I am trying to install 3rd party software, ProTools LE 8.0, on this system. I have followed all of Digidesign's special instructions and troubleshooting suggestions as posted on their w

  • Restart and waking after sleep is not working properly

    okay. a couple of things. one: sometimes, when i put my computer to sleep and come back to it later, it wont re-start up. i know it is going to happen because it is only when i open the computer and the screen flashes the sign in instead of just comi