BI7.0 Portal buffer clear

Hi,
I have assigned the iviews to roles which got migrated from BW abap to BW Portal by synchroizing the roles. 
But when user loggs in he is not seeing the reports. 
How to clear the buffer or cahse in BI Portal
Thanks
Naveen

TA SMICM -> GOTO -> HTTP Server Cache -> Display -> Delete all cache objects. Mark them and press the delete button .,
hope this helps.,

Similar Messages

  • ISE 1.1.1 Sponsor Portal - Button "Clear Filter" appeares twice

    I think I discovered a Bug with the Button labels when displaying Guest Users in the Sponsor Portal.
    When using Internet Explorer (tested 7 and 9) both butons are labeled "Clear Filter".
    It apears the same in every language template.
    When using Firefox (16.x) everything is ok.
    I added a screenshot to make clear which buttons are affected.

    FYI
    You can access the Cisco ISE administrative  user interface using the following browsers:
    •Mozilla Firefox 3.6 (applicable for  Windows, Mac OS X, and Linux-based operating systems)
    •Mozilla FireFox 9 (applicable for Windows,  Mac OS X, and Linux-based operating systems)
    •Windows Internet Explorer  8
    •Windows Internet Explorer 9 (in Internet  Explorer 8 compatibility mode)
    Note Cisco ISE GUI is not supported on  Internet Explorer version 8 running in Internet Explorer 7 compatibility mode.  For a collection of known issues regarding Windows Internet Explorer 8, see the  "Known Issues" section of the Release Notes for Cisco Identity Services Engine,  Release 1.1.x

  • SEM-BPS Variable buffer clearing issue

    Hello experts,
    I have a situation where my user wants to use BPS functionality to perform direct data entry and validations. I know it's not standard, but that's not the point.
    How do I clear the variables buffer so that each time the user enters the plan layout they are requested to enter fresh variables to determine the selection combinations?
    Is there a function module?
    What tables store this info?
    Any suggestions will be appreciated. Thanks!

    I guess I'll answer my own question.
    There are two tables I've found that holds variables they are as follows:
    UPC_VAR_CHA_SEL - Variables - Selections
    UPC_VAR_CHA_ACT - Variables - Restricted Values
    A function module was created to read these tables and delete the values, based on the userid, hence causing a refresh.
    The function module needed to be executed in the planning folder on 'save'.
    This has worked fine.

  • BI7 Portal - No authorization error when hierarchy is used

    Hi All,
    In RSRT1 tcode the user can execute the report and can get the output. The user had no issues on drilldown the hierarchies. But for the same user in BI portal he cann't get the output. he got user not authorized error.
    Please give some help on how to tackle this issue.
    Thanks & Regards,
    Madhu

    Hi Madhu,
    the earlier thread should assist you:
    Authourization to profit center issue
    Rgds,
    Colum

  • How do you flush a device's buffer using LabVIEW GPIB functions?

    I know the VISA Flush function is an alternative, but I started my program with the low level GPIB functions and it would be a huge task switching now, so if anyone knows how I would do the buffer clear I would greatly appreciate it if you can show me how it's done. Thanks.
    Otman

    Your comment about an indicator getting "clogged up with data" doesn't make any sense. The contents of a string or array indicator can get large and slow things down but a numeric indicator cannot get clogged up. If the data stops making sense, then you are incorrectly reading the instrument and converting that data to a numeric. With your comments about the device transmit buffer, I suspect you have occasionaly set the byte count too low and unread bytes are there that you then read the next time. As long as the instrument is fairly new, it will send out a termination character (typically EOI) that will terminate the read. You can then set the read count to some arbitrarily high number to ensure you've got the entire tr
    ansmit buffer contents. It's also possible that you periodicaly have an error condition where the instrument is sending unexpected information. For example, if it normally sends a floating point number as a result and then it sends an error message string, you might not be intrepreting it correctly.

  • How does data enter/leave the ni4351(pci) buffer?

    I have recently begun using an ni4351(pci) for data acquisition. I'm using VC++ on a Win95 system. I've been digging through the documentation for the ni435x instrument driver, but I can't locate an anwer to the following question: How does the buffer for the analog input scans work?
    It's stated in the instrument driver help that if the function to set the number of scans is not called, then acquisition will be continuous. My questions all revolve round the concept of continuous acquisition. I believe that I understand what's going on until i look at the fcns that read/check the acquisition.
    What is the purpose of the timeout variable? I undertand its general purpose, but it seems (to me) that we must pass a ti
    meout variable to functions that should never time out (e.g. check and read which only returns data that has already been collected).
    How is data written into the buffer? is it sequentially added? (e.g. the first data point is buffer[0] and the last would be buffer[999] in a 1k element buffer?) or maybe the most recent acquisition is stored in buffer[0] and older data gets bumped back?
    What happens to the data after a read (or check and read) has been performed? is the buffer cleared? does the data keep getting entered sequentially as if nothing has happened?
    I apologize if this is in a document somewhere on your site. Thanks in advance for your help.

    Data is written into the buffer sequentially. The buffer that the data is written to is a circular buffer. When the values are read into your program as an array, the first point that was acquired will be first in your array. The following tutorial explains what going on in hardware during a continuous acquisition:
    http://zone.ni.com/devzone/conceptd.nsf/webmain/F2DDCBAD754C687C86256802007B8514?opendocument
    I hope this answers your questions, feel free to post again if it doesn�t.
    Best Regards,
    Doug K
    Application Engineering
    National Instruments

  • Bytes read from Socket buffer

    Hi,
    I'm writing a proxy application that relays data from a server to a client that requested the data. One thing I have observed is that when I have read about 32136 bytes of data, my reads from my buffered input stream fetch only one byte at a time. Not only is my read function now reading only one byte at a time, but it takes over a minute to fetch 83 bytes of data. And the delay gets worse the longer I run.
    In an effort to stress test my app, I deliberately set the send and receive buffers of the client socket to a small value (128 bytes). I can understand that filling up the buffer could slow down the reading, but what is odd is that long after the client has digested all the data, the Input stream reads never seem to go back to their original speed.
    Is this an O/s thing? a JVM thing? I'm running JDK 1.3.1 on an intel box with Linux Redhad 6.2. It seems to me that there must be some way of getting the socket buffer clear on the receive side so that I can get something that ressembles a normal dataflow. Oh, and I tried toggling the TCP no delay flag to no avail.
    Any suggestions?
    -hugh

    However, even with a large socket buffer, there is
    always the chance that the receiving app will run
    slowly due to bad programming, network latency, etc
    (we're not the authors of the clients who will
    connect), meaning even with the maximum buffer size,
    we could fill the socket buffer. I suppose, though,
    if it is the sender app that is getting fooled, then
    it's a matter for the authors of the sending
    application.True but the same thing will happen if the client connects directly to the server without your proxy, so why worry? General tips for writing proxies: use as large a buffer as possible, run separate reading and writing threads in your proxy, and propagate an EOF by doing shutdownOutput in the opposite direction. When you have done this in both directions you can close the socket, not before.

  • Auto refresh Portal after Login

    Hi All,
    I need to refresh the Portal page immediately after login to load some content.
    How to add page refresh code and where to add?
    Probably that will happen in the masthead file but exactly what javascript i need to add.
    Thanks ,
    Amarys.

    Hi Amarys,
    java script part is pretty simple.
    Referesh()
    window.top.location.href="/irj/portal";
    The second part about where to place this will be tricky, as you may end up in infinite loop of Refresh.
    One possible solution is to write your logon module and set a flag when the login is successful. Read this flag in one of the Portal component (Say Masthead), Refresh the Portal and clear the flag.
    By the way why do you need this. If you can elaborate on what exactly you want to achieve, may be someone can suggest a better approach.
    Thanks
    Prashant

  • Conflict on ESS Portal

    Hi
    When employee apply or try to aprrove leaves  on ESS portal conflict erro with other absence or attendace type is coming. this process working fine on R3 System but not on portal.
    IT 0007 status os 0- No time evaluation.

    Hi Vikrant,
    The issue is because, the employee has applied for the leaves on portal and before it is approved, that particular date is updated via backend in IT2001.
    To resolve this issue, you will have to delete the leaves that are still in the sent status in the portal buffer area.
    You will have to use the reports RPTARQDBVIEW and RPTARQDBDEL using tcode SA38.
    Run the first report by selecting upto today option and then check the leave request in sent status that are already updated in backend in IT2001 then using the second report, select upto date option and uncheck the test run field and delete those request that you identified from the first report.  This will resolve ur issue.
    Cheers,
    Ayyaps

  • Deleting a Web app from the Azure Management Portal

    When I selected a Web app in Azure Management Portal and clicked Delete at the bottom, the message "Loading" would hang there for hours without actually deleting that Web app.  I just got started with the free trial.  Am I missing something?
    Thanks, Paul

    Hi,
    Have you linked SQL Azure Database to the webapp, please check and unlink the SQL database and then try to delete the webapp from the portal.
    Clear cookies and cache files from Internet Explorer and let us know the results.
    Girish Prajwal

  • Portal not picking up changes from query view in analyzer

    Hello All,
    If I change a query view in analyzer, the changes are not being picked up in the portal unless i restart the portal, therefore clearing the cache.  Is there away of clearing the portal cache without a restart?  I am aware of a few ways to clear navigation cache and PCD cache, but this does not solve my issue. Also I have cleared the query cache through RSRT but this makes no difference.
    Any suggestions apprecaited.
    Thanks,
    Nick

    Hi ,
    This is due to the query cache not getting updated for portal
    view this problem can be solved by only refreshing the query
    and u can get the help of basis people if there are anyother
    way for this .
    Assigning points is the way of saying thanks in SDN
    Regards ,
    Subash Balakrishnan

  • Double Buffer program is slowing down, help.

    Hello, I have a small Dancing Lines program like an old Windows screensaver program and it appears to slow down after about 30 seconds to a minute. I "clear" my buffer by copying a screen sized black symbol to the buffer. If anyone has any ideas about how to make this more efficient and most importantly stop the slow down, please let me know, thanks.
    // Variables
    var x0:int;
    var y0:int;
    var x1:int;
    var y1:int;
    var x2:int;
    var y2:int;
    var x3:int;
    var y3:int;
    var dx0:int;
    var dy0:int;
    var dx1:int;
    var dy1:int;
    var dx2:int;
    var dy2:int;
    var dx3:int;
    var dy3:int;
    var counter:int = 0;
    var clearBuffer:Buffer = new Buffer();
    var drawing:Shape = new Shape();
    var color1:uint = uint(0xFFFFFF * Math.random());
    // Initialize Line Values
    x0 = int(Math.random() * 320);
    x1 = int(Math.random() * 320);
    y0 = int(Math.random() * 200);
    y1 = int(Math.random() * 200);
    x2 = x0;
    x3 = x1;
    y2 = y0;
    y3 = y1;
    // Initializing Line Velocities
    dx0 = int(Math.random() * 5);
    dx1 = int(Math.random() * 5);
    dy0 = int(Math.random() * 5);
    dy1 = int(Math.random() * 5);
    dx2 = dx0;
    dx3 = dx1;
    dy2 = dy0;
    dy3 = dy1;
    // Double Buffer Setup
    var bitmap:BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,true,0xff000000);                          
    var buffer:BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,true,0xff000000);
    var image:Bitmap = new Bitmap(bitmap);
    addChild(image);
    // Listeners
    addEventListener(Event.ENTER_FRAME,onEnterFrame);
    function onEnterFrame(event:Event):void {
         // Clear The Sreen
         buffer.draw(clearBuffer);
         // Logic
         drawing.graphics.lineStyle(1, color1);
         drawing.graphics.moveTo(x0,y0);
         drawing.graphics.lineTo(x1,y1);
         if ((x0 += dx0) >= 315 || x0 < 5)
              dx0 *= -1;
         if ((y0 += dy0) >= 195 || y0 < 5)
              dy0 *= -1;
         if ((x1 += dx1) >= 315 || x1 < 5)
              dx1 *= -1;
         if ((y1 += dy1) >= 195 || y1 < 5)
              dy1 *= -1;
         if (++counter > 50) {
              drawing.graphics.lineStyle(1, 0x000000);
              drawing.graphics.moveTo(x2,y2);
              drawing.graphics.lineTo(x3,y3);
              if ((x2 += dx2) >= 315 || x2 < 5)
                   dx2 *= -1;
              if ((y2 += dy2) >= 195 || y2 < 5)
                   dy2 *= -1;
              if ((x3 += dx3) >= 315 || x3 < 5)
                   dx3 *= -1;
              if ((y3 += dy3) >= 195 || y3 < 5)
                   dy3 *= -1;
         if (counter > 250)
              counter = 51;
         // Draw The Screen
         buffer.draw(drawing, drawing.transform.matrix);
         bitmap.draw(buffer);
    P.S. - Is there a way I can post my code in a smaller box with a scrollbar?

    Here is a fixed version:
    // Variables
    var x0:int;
    var y0:int;
    var x1:int;
    var y1:int;
    var x2:int;
    var y2:int;
    var x3:int;
    var y3:int;
    var dx0:int;
    var dy0:int;
    var dx1:int;
    var dy1:int;
    var dx2:int;
    var dy2:int;
    var dx3:int;
    var dy3:int;
    var counter:int = 0;
    var drawing:Shape = new Shape();
    var color1:uint = uint(0xFFFFFF * Math.random());
    // Initialize Line Values
    x0 = int(Math.random() * 320);
    x1 = int(Math.random() * 320);
    y0 = int(Math.random() * 200);
    y1 = int(Math.random() * 200);
    x2 = x0;
    x3 = x1;
    y2 = y0;
    y3 = y1;
    // Initializing Line Velocities
    dx0 = int(Math.random() * 5);
    dx1 = int(Math.random() * 5);
    dy0 = int(Math.random() * 5);
    dy1 = int(Math.random() * 5);
    dx2 = dx0;
    dx3 = dx1;
    dy2 = dy0;
    dy3 = dy1;
    // Double Buffer Setup
    var bitmap:BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,true,0xff000000);                         
    var buffer:BitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,true,0xff000000);
    var image:Bitmap = new Bitmap(bitmap);
    addChild(image);
    // Listeners
    addEventListener(Event.ENTER_FRAME,onEnterFrame);
    function onEnterFrame(event:Event):void {
         // Logic
         drawing.graphics.lineStyle(1, color1);
         drawing.graphics.moveTo(x0,y0);
         drawing.graphics.lineTo(x1,y1);
         if ((x0 += dx0) >= 315 || x0 < 5)
              dx0 *= -1;
         if ((y0 += dy0) >= 195 || y0 < 5)
              dy0 *= -1;
         if ((x1 += dx1) >= 315 || x1 < 5)
              dx1 *= -1;
         if ((y1 += dy1) >= 195 || y1 < 5)
              dy1 *= -1;
         if (++counter > 50) {
              drawing.graphics.lineStyle(1, 0x000000);
              drawing.graphics.moveTo(x2,y2);
              drawing.graphics.lineTo(x3,y3);
              if ((x2 += dx2) >= 315 || x2 < 5)
                   dx2 *= -1;
              if ((y2 += dy2) >= 195 || y2 < 5)
                   dy2 *= -1;
              if ((x3 += dx3) >= 315 || x3 < 5)
                   dx3 *= -1;
              if ((y3 += dy3) >= 195 || y3 < 5)
                   dy3 *= -1;
         // Draw The Screen
         buffer.draw(drawing, drawing.transform.matrix);
         bitmap.draw(buffer);
         // clear drawing canvas
         drawing.graphics.clear();
    Basically you have to use the graphics.clear() function to erase any clip where you are using the drawing API. Drawing lots of vectors can be very costly performance-wise so you always want to clear your graphics when you are finished. Drawing over the vectors with a rectangle has no effect except to increase the load even more. However when dealing with bitmap objects you can safely draw as much as you want for as long as you wish with no performance hit. Thats why what you were trying to do with that "clearBuffer" was not doing anything. Also, setting the counter to 51 when it got to 250 was doing nothing whatsoever. Not sure what that was for. The code should work fine now.

  • Java.nio select() method return 0 in my client application

    Hello,
    I'm developing a simple chat application who echo messages
    But my client application loop because the select() method return 0
    This is my code
    // SERVER
    package test;
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.ServerSocketChannel;
    import java.nio.channels.SocketChannel;
    import java.util.Iterator;
    import java.util.Set;
    public class Server {
         private int port = 5001;
         public void work() {               
              try {
                   ServerSocketChannel serverSocketChannel = ServerSocketChannel.open();
                   serverSocketChannel.configureBlocking(false);
                   InetSocketAddress isa = new InetSocketAddress(port);               
                   serverSocketChannel.socket().bind(isa);
                   Selector selector = Selector.open();
                   serverSocketChannel.register(selector, SelectionKey.OP_ACCEPT);
                   System.out.println("Listing on "+port);
                   while(selector.select()>0) {
                        Set keys = selector.selectedKeys();
                        for(Iterator i = keys.iterator(); i.hasNext();) {
                             SelectionKey key = (SelectionKey) i.next();
                             i.remove();
                             if (key.isAcceptable()) {
                                  ServerSocketChannel keyChannel = (ServerSocketChannel)key.channel();                              
                                  SocketChannel channel = keyChannel.accept();
                                  channel.configureBlocking(false);                              
                                  channel.register(selector, SelectionKey.OP_READ );
                             } else if (key.isReadable()) {
                                  SocketChannel keyChannel = (SocketChannel) key.channel();
                                  String m = Help.read(keyChannel );
                                  Help.write(m.toUpperCase(), keyChannel );
              } catch (IOException e) {                                             
                   e.printStackTrace();                         
         public static void main(String[] args) {
              Server s = new Server();
              s.work();
    // CLIENT
    package test;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.SocketChannel;
    import java.util.Iterator;
    import java.util.Set;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    public class Client extends JFrame  {
         private String host = "localhost";
         private int port = 5001;
         private SocketChannel socketChannel;
         private Selector selector;
         public void work() {               
              try {
                   socketChannel = SocketChannel.open();
                   socketChannel.configureBlocking(false);
                   InetSocketAddress isa = new InetSocketAddress(host, port);               
                   socketChannel.connect(isa);
                   selector = Selector.open();
                   socketChannel.register(selector, SelectionKey.OP_CONNECT | SelectionKey.OP_READ );
                   while(true) {
                        selector.select();
                        Set keys = selector.selectedKeys();
                        for(Iterator i = keys.iterator(); i.hasNext();) {
                             SelectionKey key = (SelectionKey) i.next();
                             i.remove();
                             if (key.isConnectable()) {
                                  SocketChannel keyChannel = (SocketChannel) key.channel();
                                  if (keyChannel.isConnectionPending()) {
                                       System.out.println("Connected "+keyChannel.finishConnect());                                                                           
                             } else if (key.isReadable()) {                                                                                                                                                           
                                  SocketChannel keyChannel = (SocketChannel) key.channel();                                             
                                  String m = Help.read(keyChannel);
                                  display(m);                                                                                                                                                                                                                   
              } catch (IOException e) {                                             
                   e.printStackTrace();                         
         private void display(final String m) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        area.append(m+"\n");
                        textFieed.setText("");
         private void sendMessage(final String m) {
              Thread t = new Thread(new Runnable() {               
                   public void run() {                                                                                
                        try {                         
                             Help.write(m, socketChannel);
                        } catch (IOException e) {               
                             e.printStackTrace();
              t.start();                    
         public Client() {
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(1);
              textFieed.addKeyListener(new KeyAdapter() {
                   public void keyPressed(KeyEvent e) {
                        if (e.getKeyCode()== KeyEvent.VK_ENTER) {
                             String m = textFieed.getText();
                             sendMessage(m);     
              area.setEditable(false);
              getContentPane().add(textFieed, "North");
              getContentPane().add(new JScrollPane(area));
              setBounds(200, 200, 400, 300);
              show();
         private String messageToSend;
         private JTextArea area = new JTextArea();
         JTextField textFieed = new JTextField();
         public static void main(String[] args) {
              Client s = new Client();
              s.work();
    // HELPER CLASS
    package test;
    import java.io.IOException;
    import java.nio.ByteBuffer;
    import java.nio.CharBuffer;
    import java.nio.channels.SocketChannel;
    import java.nio.charset.Charset;
    import java.nio.charset.CharsetDecoder;
    import java.nio.charset.CharsetEncoder;
    public class Help {
         private static Charset charset = Charset.forName("us-ascii");
         private static CharsetEncoder enc = charset.newEncoder();
         private static CharsetDecoder dec = charset.newDecoder();
         private static void log(String m) {
              System.out.println(m);
         public static String read(SocketChannel channel) throws IOException {
              log("*** start READ");                              
              int n;
              ByteBuffer buffer = ByteBuffer.allocate(1024);
              while((n = channel.read(buffer)) > 0) {
                   System.out.println("     adding "+n+" bytes");
              log("  BUFFER REMPLI : "+buffer);
              buffer.flip();               
              CharBuffer cb = dec.decode(buffer);          
              log("  CHARBUFFER : "+cb);
              String m = cb.toString();
              log("  MESSAGE : "+m);          
              log("*** end READ");
              //buffer.clear();
              return m;                    
         public static void write(String m, SocketChannel channel) throws IOException {          
              log("xxx start WRITE");          
              CharBuffer cb = CharBuffer.wrap(m);
              log("  CHARBUFFER : "+cb);          
              ByteBuffer  buffer = enc.encode(cb);
              log("  BUFFER ALLOUE REMPLI : "+buffer);
              int n;
              while(buffer.hasRemaining()) {
                   n = channel.write(buffer);                         
              System.out.println("  REMAINING : "+buffer.hasRemaining());
              log("xxx end WRITE");

    Here's the fix for that old problem. Change the work method to do the following
    - don't register interest in things that can't happen
    - when you connect register based on whether the connection is complete or pending.
    - add the OP_READ interest once the connection is complete.
    This doesn't fix all the other problems this code will have,
    eg.
    - what happens if a write is incomplete?
    - why does my code loop if I add OP_WRITE interest?
    - why does my interestOps or register method block?
    For code that answers all those questions see my obese post Taming the NIO Circus
    Here's the fixed up Client code
    // CLIENT
    package test
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.IOException;
    import java.net.InetSocketAddress;
    import java.nio.channels.SelectionKey;
    import java.nio.channels.Selector;
    import java.nio.channels.SocketChannel;
    import java.util.Iterator;
    import java.util.Set;
    import javax.swing.JFrame;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import javax.swing.JTextField;
    import javax.swing.SwingUtilities;
    public class Client extends JFrame  {
         private String host = "localhost";
         private int port = 5001;
         private SocketChannel socketChannel;
         private Selector selector;
         public void work() {
              try {
                   socketChannel = SocketChannel.open();
                   socketChannel.configureBlocking(false);
                   InetSocketAddress isa = new InetSocketAddress(host, port);
                   socketChannel.connect(isa);
                   selector = Selector.open();
                   int interest = 0;
                   if(socketChannel.isConnected())interest = SelectionKey.OP_READ;
                   else if(socketChannel.isConnectionPending())interest = SelectionKey.OP_CONNECT;
                   socketChannel.register(selector, interest);
                   while(true)
                        int nn = selector.select();
                        System.out.println("nn="+nn);
                        Set keys = selector.selectedKeys();
                        for(Iterator i = keys.iterator(); i.hasNext();)
                             SelectionKey key = (SelectionKey) i.next();
                             i.remove();
                             if (key.isConnectable())
                                  SocketChannel keyChannel = (SocketChannel) key.channel();
                                  System.out.println("Connected "+keyChannel.finishConnect());
                                  key.interestOps(SelectionKey.OP_READ);
                             if (key.isReadable())
                                  SocketChannel keyChannel = (SocketChannel) key.channel();
                                  String m = Help.read(keyChannel);
                                  display(m);
              } catch (IOException e) {
                   e.printStackTrace();
         private void display(final String m) {
              SwingUtilities.invokeLater(new Runnable() {
                   public void run() {
                        area.append(m+"\n");
                        textFieed.setText("");
         private void sendMessage(final String m) {
              Thread t = new Thread(new Runnable() {
                   public void run() {
                        try {
                             Help.write(m, socketChannel);
                        } catch (IOException e) {
                             e.printStackTrace();
              t.start();
         public Client() {
              addWindowListener(new WindowAdapter() {
                   public void windowClosing(WindowEvent e) {
                        System.exit(1);
              textFieed.addKeyListener(new KeyAdapter() {
                   public void keyPressed(KeyEvent e) {
                        if (e.getKeyCode()== KeyEvent.VK_ENTER) {
                             String m = textFieed.getText();
                             sendMessage(m);
              area.setEditable(false);
              getContentPane().add(textFieed, "North");
              getContentPane().add(new JScrollPane(area));
              setBounds(200, 200, 400, 300);
              show();
         private String messageToSend;
         private JTextArea area = new JTextArea();
         JTextField textFieed = new JTextField();
         public static void main(String[] args) {
              Client s = new Client();
              s.work();

  • Is there a way to set timeout in asynchronus sockets ?

    Hi,
    I'm writing client-server application (many clients). Server get's data from all clients periodically. My issue is: clients can send big parts of data, and beetwen consecutive write operations on client some breaks can occur (eg. 2sec.).
    What happens on server is: read method returns bytes in while loop unitil it returns 0. And 0 is returned when that break occurs on client. So the issue is that server thinks it is already the end of the transmission (while loop ends and I begin to analyze data which was send), whereas some data will arrive after eg. 1second. How can I address that issue ?
    At the moment I'm testing my app on Windows but eventually it will run on Linux. I'm using Java Non-blocking Sockets.
    Thanks, Pawel
    Edited by: PawelWu on Mar 4, 2008 12:33 PM

    Just in case I didn't make myself clear.
    CLIENT: That code pretends break in sending data. Data wrote to server in second iteration is not recieved by the server.
    for(int i = 0; i < 2; i++ )
         String toSend = _data.get(0);
         System.out.println("Sending data: "
                   + toSend);
         buffer.clear();
         buffer.put(toSend.getBytes());
         buffer.flip();
         client.write(buffer);
         if ( i == 0 ) {
              System.out.println("1/2 Data send... sleeping");
              Thread.sleep(5000);
         } else {
              _data.remove(0);
    System.out.println("Data send");SERVER: Server gets only 1/2 of the data.
    _buffer.clear();
    while (channel.read(_buffer) > 0) {                         
         _buffer.flip();
         while (_buffer.hasRemaining()) {
              int i = _buffer.get();
              System.out.print((char) i);
         _buffer.clear();
    System.out.println("\nAll data read!");

  • How to setup AI to AO

    I know this is probably possible, I just don't know how to
    best go about doing it. I would like to write a program to sample a waveform
    off of AI0 and output that same waveform on AO0 real time (or as close to real
    time as I can get) - with the eventual goal of doing some processing on that
    waveform in between. But for right now all I am trying to do is create a
    program to do AI to AO.
    The examples I have seen for doing simultaneous AI/AO have the output fixed
    while it samples data on the input. That is not what I want. I want to be able
    to spit out the signal that is present on the input ADC. Also when I try to
    modify the program, I get these long (5+ second) delays in between what is
    present on the input and what it produces on the output. I have tried
    increasing the sample rate and/or reducing the number of samples but that just
    causes errors – I’m loosing data because one process is taking too long to
    complete.
    Is there a way to make a streamlined program to simulate an
    analog buffer?
    Details:
    NI Device: USB 6251
    Software: Labview 8.5
    Preferred Sample Rate: 40 kHz
    Preferred delay AI to AO: < 0.1 second
    I have no code started that I could post. I am wondering if
    anybody has done this or has an idea about how to do it, i.e. I need to use a
    queue to buffer data from the AI chain to the AO chain.
    Thanks
    Jim

    Hello Jim,
    Andre is correct that our main concern here is going to be the buffer
    delay.  There are 2 other main delays that we need to be concerned
    about as well.  These are  software processing and USB bus transfer
    rates.  Andre's example for the output should work, but I believe it is
    a little more complicated than you probably need.  He is using a state
    machine architecture with an event structure, which is easy to expand
    but can be difficult to follow for a task such as yours.
    The producer/consumer would work as well, especially if the processing
    you are planing on implementing is significant, but this too I think
    may be beyond your initial goal.  This is, however, a great way to get
    rid of "loosing data because one process is taking too long to
    complete."
    The reason you are seeing the delay is most likely due to the buffer
    clearing out.  When you call the DAQmx write, it puts the data at the
    end of the buffer, so all the data ahead of it needs to be output
    first.  You can reduce this delay by using non regeneration (see the
    example program named Cont Gen Voltage Wfm-Int Clk-Non  Regeneration.vi
    in the Example Finder) and writing smaller chunks (samples to write). 
    The trick with this is you will get an error if you do not keep some
    data in the buffer that has not been written.
    You also might want to get rid of buffers all together and use hardware
    single point timing for your output (instead of continuous).  This is
    when you write 1 point at a time to the card and it is output on the
    next hardware timed sample clock pulse.  You can use this in
    conjunction with the Wait for Next Sample Clock.vi (in the DAQmx Real
    TIme palette).  The problem with this is that because you dont have a
    buffer, you can only go as fast as you can write points (my computer
    could go about 500Hz if I did not do anything else at the same time).
    The USB is a slower bus than, for example, PCI.  This means that it takes longer to get data to and from the board (there is a lot of overhead).  This could become an issue at the rates you want.
    I hope this gives you some ideas.  Let me know if you want me to go into more depth about anything or if you have any questions.
    Message Edited by Neal M on 06-17-2008 01:20 PM
    Neal M.Applications Engineering       National Instruments        www.ni.com/support

Maybe you are looking for

  • How do I share a iphone camera video with my Mac and iPad

    I have several videos from 2 to 5 minutes long I took with my iphone. The files are too long to email. I have photo stream and pictures share but videos do not. How can I get video on my mac so I can better view and share.

  • HT201788 How do I burn photos onto a DVD from iPhoto?

    I am trying to burn photos/folders from iPhoto onto a DVD/CD but when disc utility opens I am unable to burn any of the items or folders onto the disc.  I thought that my optical drive was perhaps malfunctioning so I purchased a SuperDrive.  However,

  • Printing of Withholding Taxes

    Hello All, While printing the withholding taxes there is no control like a tax certificate can it be printed any number of time??? Reply me ASAP. Regards Aditya

  • How to recover a previous version of a PSD after closing the file

    I made a mistake flattening a PNG and accidentally saved over the original PSD and lost all of my layers. In my efforts to find a way to recover it before attempting to rebuild from the flattened image, I found this post: "Hmm,I just did a stupid act

  • Web workers and JS database

    Hi there, I'm trying to create a JS database from within a web worker, in order to maximise UI when undertaking expensive DB queries. I have the web worker and main JS thread successfully communicating back and forth. However, I can't create a JS dat