Question: Usage of socket's read/writeObject()

Hi, i'm currently building a server socket that is intended to send the dataprovider object to its clients. It will send the client the list of users currently connected to the server.
The Server.
var userz = new DataProvider();
  sObj.addEventListener(MouseEvent.CLICK, fl_MouseClickHandler);
        function fl_MouseClickHandler(event:MouseEvent):void
            for each( var socket:Socket in sockets )
                                socket.writeObject(userz)
                                socket.flush()
The Client.
function sData(e:ProgressEvent)
    var dp = soc.readObject() as DataProvider
    trace(dp)
I got this error everytime trying to send the object.
RangeError: Error #2006: The supplied index is out of bounds.
    at flash.net::Socket/readObject()
    at PeerNetCS5_fla::MainTimeline/sData()[PeerNetCS5_fla.MainTimeline::frame1:24]

Its possible that the shell deals with {} as a regular expression, and hence not passing it to find. A solution would be to escape them:
-exec ltr \{\}
Another solution is to feed the output from find directly into ls by using ``:
ls -lrt `find /main_directory -name core`
.7/M.

Similar Messages

  • Question about opening sockets

    Hello I have some questions about using sockets.
    I made a program which works with sockets.
    I have a class which contains this
    static byte[] send(byte outbuf[], int len, byte recbyt[], long recip[])
            InetAddress dst = InetAddress.getByName(sendip);
            DatagramPacket request = new DatagramPacket(outbuf, len, dst, sendportint);
            DatagramSocket socket = new DatagramSocket();       
    socket.send(request);
      DatagramPacket packet = new DatagramPacket(inbuf, inbuf.length);
    socket.receive(packet);
      }In another class I call this method like this
    for(int i=0;i<rows;i++)
    send(byte outbuf[], int len, byte recbyt[], long recip[])
    }As you can see it opens a socket when sending something but never close. Does this mean that evrytime I call send it opens a new socket??
    So that if rows is 500 after this loop 500 socket are opened??
    When I place close.socket after socket.receive() it works the same. Is this better or not??

    What do you mean with this line
    Method ends, Socket gets GCed and closes on GCDo you mean when the method ends the socket closes??
    And what is GC?

  • Enabling usage rights in Adobe Reader corrupts PDF text

    Hi,
    I've created a registration form using Open Office writer which has editable fields. I convert this to a PDF and then add a signature field in Acrobat 8.
    At this point everything works fine, all the editable fields etc convert across, but I want people to be able to sign and save the form in Reader, so I check the "Enable Usage Rights in Adobe Reader" feature and save it. Now when I open the PDF in either Acrobat or Reader all the text is completely corrupted and illegible (see image).
    Any idea what's going on here?
    Thank you
    Paul

    OK, here you go.
    https://www.dropbox.com/sh/y5mkwmw5h8wvxjk/2psk7418jq

  • How to set enable usage rights in adobe reader?

    Dear all,
    How to set "enable usage rights in adobe reader..." in acrobat sdk?
    I did that through menu event but it shows saveAs dialog window.
    Please anyone guide how to handle the saveas window. Otherwise if there is any method to directly enable the option.
    Thanks...
    vijay

    There is no way to automate this in the Acrobat SDK.  If you need to automate Reader Enablement, you need another product – LiveCycle Reader Extension Server.

  • Problem with enabling usage rights for Adobe Reader

    Hi All,
    I have designed a form using Live cycle. From Live cycle I export it as PDF. As a final step, I open the PDF by using acrobat professional to enable usage rights for Adobe Reader. As soon as I enble the rights it saves the document with a different name, which is fine. However; at the same time it also runs the postsave events from the form and removes a couple of objects. How do I avoid this? My form has very little code:
    There is a drop down field called 'LearningSolutionsAdvisor' which has the following code on PostSave event:
    NewHorizons.Page1.LearningSolutionsAdvisor::postSave - (FormCalc, client)
    LearningSolutionsAdvisor.access ="readOnly"
    There is 'Save' button which has the following code:
    NewHorizons.Page1.Save::click - (JavaScript, client)
    app.execMenuItem("SaveAs");
    NewHorizons.Page1.Save::postSave - (FormCalc, client)
    Save.presence = "invisible"
    I thank you for your help in advance.
    Regards,
    Girish

    This video is very helpful as it explains exactly what I want to do:  Extend Features in Adobe Reader, to allow my readers to save their changes.  However, I do not have that option in my version of Adobe X Pro 10.1.4.  Can anyone explain to me why I don't have that option, and what an alternative would be?  

  • Question - How do I download reader 10.1.0.534?

                                                                                                                thurs.  1/2/2014 - 11 am
    I use Belarc Advisor to list all the programs, etc. on the computer. It tells me that I need a CRITICAL download of Adobe Reader 10.1.0.534 for security purposes. (This carries a hotfix Id -APSB13-22)
    I have tried going into Adobe and downloading the file - however I have never been able to find that exact file(by number). What I have tried to download - with similar numbers- does not download. Microsoft  Security essentials is supposed to down load all needed security info automatically. Why this one did not download - I do not understand. Whether I understand it or not - if it is critical - then I want to download it ASAP. If you have any suggestions - PLEASE keep instructions as simple as possible.
    Thank you                                                                                                      R D Rodda

    1/7/14 - thank you for your reply and help. got the problem fixed & download installed. - Thanks again - R D Rodda
    Date: Thu, 2 Jan 2014 21:58:41 -0800
    From: [email protected]
    To: [email protected]
    Subject: Question - How do I download reader 10.1.0.534?
        Re: Question - How do I download reader 10.1.0.534?
        created by Pat Willener in Adobe Reader - View the full discussion
    If you are going to install 10.1.0, you are going to install another old, insecure version.
    If you need/want to stay on version 10.x, you should install version 10.1.8:
    download and install version 10.1.4 from http://get.adobe.com/reader/enterprise/then update to version 10.1.8 using Help | Check for Updates...
         Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at http://forums.adobe.com/message/5976050#5976050
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/5976050#5976050
         To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/5976050#5976050. In the Actions box on the right, click the Stop Email Notifications link.
               Start a new discussion in Adobe Reader at Adobe Community
      For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Socket stream read() method blocks

    Hi,
    client connects to our server socket.
    our thread blocks for getting the input data from the client, but the client is closed with out sending any data.
    so our thread is blocked for the input data for ever.
    how could our application will know that the client socket is closed.
    once we got some data from the client , after that client is closed then we can know that the client is closed because read() method will return -1 .
    Thanks ,
    S P K S.

    yes you are right when the client sent some data then after some time connection got closed , then our read() will return -1It doesn't matter whether the client has sent data or not. If the client closes the connection properly your read will return -1.
    but here my problem is just client is connected , he didn't send a bit of data , connection got closed ,in that case read method is still waiting for the input it is not returning any thing and not throwing any exception.If the connection is dropped abortively a read can block forever. Your defence against this is to use a read timeout of say 60 seconds. or whatever is appropriate for your application. See Socket.setSoTimeout().

  • Acrobat x pro - Enable Usage Rights in Adobe Reader

    Hi,
    Can any one tell me how to Enable Usage Rights in Adobe Reader?
    Thanks for looking into this.
    Regards,
    Sudhakar

    Be sure to read the license agreement. It has restrictions on the use of Reader Rights. The restrictions depend on your planned use.

  • Socket.InputStream.read()

    public ServerThread(ThreadGroup t, Socket con,lServer master, int clientId) {
         super(t, "server");
         this.con = con;
         this.master = master;
         this.clientId = clientId;
    void run(){
        int task = 0;
        try {
            out = new DataOutputStream(con.getOutputStream());
            in = con.getInputStream();
            out.write(job.KN_NewClientID);
            out.write(clientId);
        } catch (IOException e) {
            melde("\nIOException  in run : " + e);
            return;
         * Start waiting for input
        while (true) {
            try {
           *   next line conecersn my question
           *===========================
                task = in.read();
                switch (task) {
                  // more          
            } catch (IOException e) {
                System.out.println("IOException  Serverthread  : " + );
                return;
    }When the above ( code-snippet) Thread is waiting for input
    task = in.read();
    In I create another thread, which will try to send and receive with the same socket in and -out.
    does the above thread block the second ?
    and if so, how do I avoid this
    TIA
    Hanns

    i like this forum: http://forum.java.sun.com/forum.jspa?forumID=11
    as for the question,
    http://java.sun.com/developer/onlineTraining/Programming/BasicJava2/socket.html#sockets
    what i can get from this, is have a listener, listen for new connections, every connection established, create a new thread, these threads will have their own input and output streams, so you wont have to worry bout watchyamacallits
    then again, your threadgroups, im not following your code, but all i can say, is the socket examples work

  • Question re master socket vs secondary and install...

    I'm seriously considering switching to Infinity but have a question re sockets. My current modem and network gigabit switching are all upstairs, coming from a secondary socket running outside the house from the master socket on the ground floor. I want to have the new infinity modem etc in the same upstairs room as now so I don't have to muck around with my existing network cabling. My question is can the egineer use the existing cabling and convert the upstairs socket without having to run a new cable from the master socket downstairs (as it would be next to impossible to drill through the ceiling etc without my partner killing me) as this is the deal breaker for me and Infinity? Many thanks

    He should be able to do that for you.

  • Socket DataInputStream read SocketTimeException

    Hi all,
    I got a socket client/server, but while read(), the client do heartbeat every 1/4 second, and following is the heartbeat's mainly code.
    The question is there will be a Timeout exception intermittently. I mean it during 100 times heartbeats, there will 1~2 times failed to read(), but the followed thrid can successfully read from the inputStream.
    socketClient.setSoTimeout(10*1000); // timeout 10s
    DataInputStream input = socketClient.getInputStream();
              byte[] outputData = null;
              try {
                   byte[] outputDataTemp = new byte[252];
                   COSLogger.doInfo("ModbusRequest", "execute", "input.available() = "+input.available());     // why available() always is 0?
                   int size = input.read(outputDataTemp);// SocketTimeoutException occured here
                   if (size <= 0) {
                        throw new Jnior310Exception("Invalid zero-length response from jnior.");
                   outputData = new byte[size];
                   for (int i = 0; (i < size); i++) {
                        outputData[i] = outputDataTemp;
              } catch (IOException e) {
                   throw new Jnior310Exception("IOException on read: " + e);
              }Any reply is appreciated.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    than wrote:
    Please note in most time it read correctly, in this situation the weird thing is input.available=0, but the after sucussful read(), the size=10Returning 0 is the default behavior of the available function of a DataInputStream. The API for DataInputStream says :
    Returns an estimate of the number of bytes that can be read (or skipped over) from this input stream without blocking by the next caller of a method for this input stream. The next caller might be the same thread or another thread. A single read or skip of this many bytes will not block, but may read or skip fewer bytes.
    This method returns the result of in.available(). where in is an InputStream. The API for InputStream says :
    The available method for class InputStream always returns 0I only know this because I recently made that mistake as well...but the available function is basiclly useless in this instance (Unless you're looking for a confusing way to initialize a for loop)...

  • Security question about opening PDFs in Reader as opposed to Standard or Professional

    Our ITC wants us to open all downloaded PDFs in Acrobat Reader 9 as opposed to Acrobat 7.0 Standard. We currently have both. We download a lot of PDFs and frequently need to Reduce File Size or extract pages, etc. I am hoping to upgrade my Acrobat 7.0 Standard to Professional 9.
    Is there a valid security reason to always open first in Reader? Based on what I have read Acrobat Reader 9 and Professional 9 both had security risks and it is my understanding that a patch has been released today.
    Is there a security risk still for Acrobat Professional 9 and is there a security risk for Acrobat Standard 7.0? Does requiring us to download, save and open PDFs in Reader 9 first make sense from a security standpoint?
    Thanks very much for any input.

    I don't remember any claims that Reader was safer than Acrobat. I use Acrobat exclusively and Adobe recommends against installing both due to conflicts (they use a lot of the same files). The biggest factor to be careful about is to not open any attachments or applications that may be built in. These can be put in the PDF and both Acrobat and Reader open such tools. I would tend to question the basis for the IT folks decision, particularly based on the Adobe recommendation and problems that it creates. At least that is my opinion.

  • Question in using sockets in parsing XML!!!!(urgent plz help)

    i have a server/client program and the client has some XML files the server want to process and parse them using DOM.
    But i want to do this without having to transfer neither the whole file nor line-by-line of the file
    does anybody know how to do this???
    how to connect the output stream of the socket of the client with this file??
    thanks in advance

    i did it and here are the exact line of code to do it:
    DocumentBuilderFactory factory =
    DocumentBuilderFactory.newInstance();
    /factory.setValidating( true );
    // obtain object that builds Documents
    DocumentBuilder builder = factory.newDocumentBuilder();
    URL url = new URL("file://comp1/xml/Stack.xml");
    // obtain document object from XML document               Document document = builder.parse( url.openConnection() .getInputStream() );

  • Socket InputStream read , slow performance

    Hi ,
    We have developed a java socket appliction ,
    This application will be connected to a configured client socket .
    client socket will send huge no of messages to our application , our application will receive the messages and do the need full things,and send the acknowledgement to the client.
    In order to receive the messages we are using the code like this
    public void run(){
    socket_InputSteram = Socket.getInputStream()
    while(true){
    // read the message from the connected socket input stream.
    readMessage( socket_InputSteram );
    now comes the actual problem , for some number of messages our application is stable and doing well , after some time our application is taking almost 100% CPU and very slow.
    can any body help me why our application is taking 100% CPU , why it is faster in the initail stage and it is very slow after some time . what are the necessary steps we have to take inorder to read the socket input stream.
    i would be very thank full, if any body can provide the solution
    Thanks,
    SPK Srinivas.

    Is it actually using CPU time or only wallclock time? In the latter case it's probably just waiting for more data to arrive and you should concentrate on the next method(s) in the list.
    If it's actually using up CPU, then you might want to check if you're using it inefficiently.
    Prime examples: Reading a single byte at a time. If you do something like this:
    int b;
    while ((b = in.read()) != -1) {
      // do something
    }Then you're doing something wrong and should read into a buffer (byte-array) instead.

  • Socket buffered read yields corrupt data

    While trying to read from a socket, the data gets corrupted:
    First, from telnet, I send the length of the data: 12<enter>
    Then I send the data: this is some data
    The server only displays part of the data:
    �� = some unprintable character (I can't even copy it from the console)
    examples:
    SEND 11<enter>
    SEND this is a test for
    System.out.println yields: "this is &#8234;������"
    SEND 11<enter>
    SEND this is a test for socket data
    System.out.println yields: "this is &#8234;������"
    SEND 13<enter>
    SEND this is a test for socket data
    System.out.println yields: "this is &#8234;����������"
    SEND 13<enter>
    SEND this is a test for socket data, yes, for sockets
    System.out.println yields: "this is &#8234;����������"
    SEND 20<enter>
    SEND this is a test for socket data, yes, for sockets
    System.out.println yields: "this is ������������������������"
    s_out = new PrintWriter(s_socket.getOutputStream(), true);
    s_in = new BufferedReader(new InputStreamReader(s_socket.getInputStream()));
    AProtocol proto = new AProtocol();
    int data_length = 0;
    while (proto.state != STATUS_GOODBYE){
         switch (proto.state) {
         case STATUS_WAITING_LENGTH :
              inputLine = s_in.readLine();
              s_out.println(proto.processInput(inputLine));
              if (proto.state == STATUS_WAITING_DATA){
                   data_length = Integer.parseInt(inputLine.trim());     
              break;
                                  case STATUS_WAITING_DATA :
              inarray = new char[data_length];
              if ((count = s_in.read(inarray,0,data_length)) >= 0){
                   inputLine = String.valueOf(inarray);
                   proto.processInput(inputLine);
                   if (proto.state == STATUS_WAITING_LENGTH){
                        System.out.println("*" + inputLine + "*");
              break;
    }

    It looks like you're writing bytes, but reading them as Java characters (e.g., Unicode).

Maybe you are looking for

  • IC Webclient starts with problems

    Hi all,     I'm new in IC WEB, especially in version 5.2. The question is I tried to launch IC Web client (transaction se80->test) as I used to do in 5.0, but It doesn't show neither navigation bar nor IdentifyAccount view, I mean, it only shows the

  • Pages won't open a doc, telling me I require the newest version of pages to open the doc, but I have 5.0.1

    I wnat to open a doc i created recently, but Pages tells me I require a the newest version of Pages, whicj I already have.  THis has happened repeatedly.

  • Simulate Sales Order

    Hi, I am trying to simulate a sales order creation using the function 'BAPI_SALESORDER_CREATEFROMDAT2' with TESTRUN = 'X'. But i have a problem... i don't have a sales order number, because this is a simulation, but is that normal? How can i see the

  • FMLE not recognizing external camera

    I have the following configuration: Mac Book Pro FMLE Version 3.2 External Camera Source - Sony PMW-EX1 connected via i-Link (Firewire/HDV) Camera shows up in Firewire Devise List FMLE defaluts to iSight Camera Source External camera is not an option

  • Solution for Analog Stereo System

    I have been a Mac user for years. I currently have a Macbook Pro and have had it hooked up to my wireless network using the Airport Express. Due to a change with my VoIP carrier, I decided to get the Time Capsule. Everything is working just great, ex