TCP Read Locks up System

Hi,
I'm attempting to read a line from a TCP Socket using the following code, but for some reason, it locks up my system. Can anyone explain why?
          try
               Socket sock;
               BufferedReader istream;
               BufferedWriter ostream;
               //PrintStream ostream;
               String readstring;
               sock = new Socket("my-server-tis-of-thee",5100);
               istream = new BufferedReader(new InputStreamReader(new DataInputStream(sock.getInputStream())));
               ostream = new BufferedWriter(new OutputStreamWriter(new DataOutputStream(sock.getOutputStream())));
               ostream.write("Shoo fly last\n");
               while((readstring = istream.readLine()) != null)
                    System.out.println(readstring);
                    if(readstring.contains("rawr"))
                         break;
               System.out.println("closing sockets");
               ostream.close();
               istream.close();
               sock.close();
          catch(Exception ex)
               ex.printStackTrace();
          }I'm able to open up the socket correctly, but for some reason, and the code executes fine as long as I comment out the "while" loop, but when I throw it in, everything freezes up. Any suggestions?
Thanks,
hhung
Edited by: hhung on May 14, 2008 10:03 AM

... presumably by putting the blocking I/O in a different thread from the AWT event thread ...

Similar Messages

  • Continuous TCP reading from RT system

    Hello everyone!
    Project:
    I have an AVR32 Board which continuously collects data and sends it to a PC. The PC communicates with the AVR via LabVIEW for data processing and e.g. setting the measurement parameters. Up until now I used a RS232 connection and processed the incoming data via the VISA driver. But since the serial connection is so slow I now want to upgrade to TCP/IP.
    Current working state:
    With the serial connection I checked the COM-port buffer every n milliseconds and processed the data in a queue afterwards. So basically my VI checked if the PC received something and processed it right away.
    Problem:
    So I tried to create a similar VI with TCP Read and I thought that I neededed the Immediate mode. I wanted to do this since it's a continuous data stream with a custom protocoll where the package sizes vary. But while wireshark tells me that the data packages arrive, I can't read them in LV.
    Basically I have the same problem as this guy. But sadly he already worked it out without enlightening poor bastards like me . So could you please help me with this?
    I attached my current testing VI.
    Thanks,
    Prunebutt
    Solved!
    Go to Solution.
    Attachments:
    tcp_test.vi ‏12 KB

    Sorry for the doublepost... where's the edit button? o.O
    Ok, I could've figured it out by myself. My problem was that I had to specify how many bytes there where to read. My VI received the packets as soon as I told it to wait for 1 byte to read.
    Thanks for reading anyways.

  • Adobe Reader 10 failed to  install. Upgrade hung up at "installing Features" & locked up system.

    Adobe Reader 10 failed to  install. Upgrade hung up at "installing Features" & locked up system.  Tried second time and got "process interrupted" error.  Trch support NOT available, chat not available, nothing here seems to work.

    When everything else fails, you may want to try the following:
    Run this fix from Microsoft: http://support.microsoft.com/mats/Program_Install_and_Uninstall
    Uninstall all traces of any versions of Reader using Add/Remove Programs
    If you want to reinstall Reader, download it from http://get.adobe.com/reader/enterprise/

  • Help with a fcpx library that is locked "could not be opened. Read-only file system"

    Hi all,
    I recently moved all my fcpx projects/events to a new Harddrive - I thought I did this correctly by copying/duplicating all projects/events from within FCPX.
    When I last used FCPX all the projects/events were there - no issues.  Also, when I look at package contents - everything is still there in terms of events and file sizes.  
    All the library files are on an external hard drive, on an encrypted disk image.  Now a week later I have tried to open FCPX and I get the following error
    "The document “MND_Z_FCPX” could not be opened. Read-only file system" and nothing will open.
    Have checked permissions - these all seem in order.  OSX is10.9.5 
    Any suggestions as to what might be the issue? 
    Thanks in advance.
    R

    the permissions themselves look ok - they have my two computer profiles as read/write.   I also note that on some occasions the library has opened in my other Computer profile, but not in the one that I want it to open.
    So I think you're right, there is something with permissions happening here.  I keep a work and personal computer profile.
    Don't know how it happened - but the volume is definitely Read Only - even though I've created a Read/Write permissions for it

  • Error 56 Occurs When Using TCP Read.vi

    TCP Read gives Error 56: The network operation exceeded the user-specified or system time
    limit?
    TCP Read in my application in not reliable. It works sometime, but it fails some other time. I tried to read just 1 byte, and set time out to be 1 min, I still get error code 56. What could cause this problem?

    Most of the time it is due to a poor implementation of TCP-IP and the protocol implementation ontop of that.
    There can be several causes.
    Once the device we talked to could not handle the network traffic, resulting in several TCP-IP retries (part of TCP-IP) and showing the result only after minutes. There was loads of traffic on the network and the device was overloaded with traffic it shouldn't even been listing to. Solution was a router.
    It could just as easily be something else.
    Please post a screenshot or code snippet that shows your implementation and we can give you pointers.
    André
    Regards,
    André
    Using whatever version of LV the customer requires. (LV5.1-LV2012) (www.carya.nl)

  • TCP Read w/ #bytes=4 returns wrong data.

    On an initial TCP Read to a just-open connection, I can read any number of bytes, always getting the first n bytes from the arriving data. Except when I try to read 4 bytes! Then I get 4 bytes, but they're the seventh through ninth bytes, not the first four. Haven't found any other number that gives problems - 1,2,3,5,6,7,8,16,40,1020,etc. all work fine. Ideas?

    You may want to try runnig the Data Client and Data Server example VIs which ship with LabVIEW and see if they work on your system. The Client example actually reads in 4 bytes every time. I ran it and it works fine, so if yours exhibits the behavior you've been seeing, then the problem could be with your connection. Otherwise, if the example does work, then it could be somewhere in your code. Let us know what you find.
    J.R. Allen

  • TCP read error 57

    Hi, everyone:
    In my graduation design,  I need to acquire the data of biscuits from a video and then send it to a VC program. I've achieved the sending process correctly and the program can receive the data. But when I wanted to send a message from the VC program to LabVIEW, the TCP  read error 57 occurred.
    The TCP write VI and the TCP read VI are in different loops, and they use the same refnum. In the picture, the case structure in top while loop is the data acquiring program so I don't show them.
    Can anybody teach me how to correct this program so it can receive data from the VC program? Thanks and forgive my poor English!

    Hi,
    Today i haven't any problem on the connection. The file is not changed. I think the system held some processes those use the tcp connection. I didn't think to watch in the task manager. It is the only explanation that I can pop out. Anyway I put above the program that gave me that problem. Please, check if the application is bad-built and suggest to me an alternative. Thanks
    The block linked over is send-receive packet, opened above. In the first frame the block above send a message on the tcp connection, then it waits 1 second, finally it waits for the answer on the same connection (8 seconds).
    The tcp reading block returns error 57. No other request on the same connection is active. I let the timeout of the block to end every 50 ms, I ignore error 56 (timeout) end I terminate the loop execution if:
    - a message of a least 5 character is received (application protocol specification).
    - the timeout of the receiving block ends (8 seconds)
    - a tcp error different from 56 turns out.

  • Read only file system and Problems witth pacman -S

    Hi im a newbie at Arch, and i have 2 problems...
    1) When I log in as a root user i can't modify any of the configuration files cause i only have a " Read only file System" does anyone know how  I can  change this cause im sick of using my live cd to modify the files i need to change..
    2) I have problems with pacman -S it says " Unable to lock database if you're sure pacman is not already running you can remove /tmp/pacman.lck"
    when i do rm /tmp/pacman.lck it says that it can't be done cause the file doesn't exist.. and Im sure that my dhcp and dns is working fine... (just in case of any wonder)
    Well if someone could help me i really would appreciate it
    thanks

    # <file>      <dir>           <type>     <options>           <dump>      <pass>
    none                 /dev/pts        devpts     defaults               0          0
    none                 /dev/shm        tmpfs      defaults           0          0
    /dev/cdrom           /mnt/cd          iso9660   ro,user,noauto,unhide  0          0
    /dev/dvd             /mnt/dvd         udf       ro,user,noauto,unhide  0          0
    /dev/fd0         /mnt/fl          vflat     user,noauto            0          0   
    /dev/hda6          swap            swap      default                0          0
    /dev/hda5/            ext3        defaults      0  0
    /dev/hda7/mnt/windows vfat  rw,usev,auto,umask = 000 0 0
    fsck -fC /dev/hda5 didnt work it said... "Error while executing fsck.ext3 for /dev/hda5

  • Does Toshiba lock the system at factory?

    Hi,
    ok - further to my previous post trying to reinstall the OS using the recovery CDs on a replacement hdd in a Satellite A30 (I tested and eliminated the possibility of partition and gb size problems)
    I have a question if Toshiba locks the system so I can't actually replace the hdd and won't be able to use the recovery CDs. I went into bios to autodetect the new hdd and the option was greyed out and couldn't be selected.
    Any experience with this? Cheers
    NJ

    Hi,
    usually they are not locked, I dont know how you can imagine it, just by seeing some bios option. Did you already tried to exchange the HDD?
    If no, just do it, the HDD will be recognized by the system and you would be able to use it since toshiba DOES NOT lock their systems.
    I know it because I have now about 5 machines from toshiba and by every machine the HDD was replaced so I never had any problems with it.
    Greets
    P.S.: And please forget the bios, you wont really need it.. :)

  • CVCs locked by system

    Hi,
    I have some cases that some CVCs are locked by the system BTC_SYS_APO. What does this mean, and how to bypass this error? Even  after running the job again, I am facing the same kind of issue.
    Regards,
    Guru Charan.

    You can go to SM12 and unlock the respective CVC. I think BTC_SYS_APO is user id which is locking the system while you are executing some jobs. Please cross check if you some parallel jobs are running at the same time, which are locking these CVCs.
    Hi Amol,
    First, thanks for your immediate response. BTC_SYS_APO is not a usre ID, and there are no paralled jobs running on the same planning area at that time. Anything more from your side which might be helpful?
    Regards,
    Guru Charan.

  • Enqueue: Transfer error while reading lock entries.

    Hi
    We have an error in our SM21 log in ERP Prod system.
    we have enque process on our CI server.
    any body could provide the solution?
    "Enqueue: Transfer error while reading lock entries
    > Destination: prodecccs_ERP_00
    > ENQUE_READ exception code: 8
    > Name or password is incorrect (repeat logon)"
    Thanks,
    Ravi.

    Thanks Ravi,
    that's a big help.  unfortunately for us, we're already on a release that includes that note (SAPKB70209).  So I'll get a message opened to see if they can update that note so we can apply the fix.  at least I know what component to open it under now.
    I owe you one man.
    --NICK

  • Cell multiblock physical read on exadata system

    delete is taking forever and the session is waiting on 'cell multiblock physical read' in exadata system.
    delete from ept.prc_rules_ref where end_dt < ( select min(cycle_dt) from ( select distinct cycle_dt from ept.prc order by 1 desc ) cd where rownum  < 4 ) ;
    where as the select runs in less than few seconds..
    this is the explain plan of the delete..
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Pstart| Pstop |
    | 0 | DELETE STATEMENT | | 1454 | 43620 | 95432 (3)| | |
    | 1 | DELETE | PRC_RULES_REF | | | | | |
    | 2 | TABLE ACCESS STORAGE FULL | PRC_RULES_REF | 1454 | 43620 | 273 (1)| | |
    | 3 | SORT AGGREGATE | | 1 | 9 | | | |
    | 4 | COUNT STOPKEY | | | | | | |
    | 5 | VIEW | | 3 | 27 | 95159 (3)| | |
    | 6 | SORT UNIQUE STOPKEY | | 3 | 24 | 94120 (2)| | |
    | 7 | PARTITION RANGE ALL | | 19M| 152M| 21356 (1)|1048575| 1 |
    | 8 | INDEX STORAGE FAST FULL SCAN| PRC_2_IE | 19M| 152M| 21356 (1)|1048575| 1 |
    when i check the explain plan of the select part, this is what we get ..
    | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Pstart| Pstop |
    | 0 | SELECT STATEMENT | | 1 | 9 | 95159 (3)| | |
    | 1 | SORT AGGREGATE | | 1 | 9 | | | |
    | 2 | COUNT STOPKEY | | | | | | |
    | 3 | PARTITION RANGE ALL | | 3 | 27 | 95159 (3)|1048575| 1 |
    | 4 | VIEW | | 3 | 27 | 95159 (3)| | |
    | 5 | SORT UNIQUE STOPKEY | | 3 | 24 | 94120 (2)| | |
    | 6 | INDEX STORAGE FAST FULL SCAN| PRC_2_IE | 19M| 152M| 21356 (1)|1048575| 1 |
    Sql Statement
    delete from ept.prc_rules_ref where end_dt < ( select min(cycle_
    dt) from ( select distinct cycle_dt from ept.prc order by 1 desc
    ) cd where rownum  < 4 )
    Event Wait Information
       SID 564 is waiting on event  : cell multiblock physical read
       P1 Text                      : cellhash#
       P1 Value                     : 398250101
       P2 Text                      : diskhash#
       P2 Value                     : 1099358214
       P3 Text                      : bytes
       P3 Value                     : 729088
    Any pointers why it is not going for a smart scan? the table is not huge either it has only 27000+ records.

    Taking away exadata from the picture, delete's have lot of overhead to be performed ( extra level of locking, maintaining indexes, buffer cache operations, redo/undo maintenance  etc ..) than selects. From the delete sql explain plan , its going for a  FTS(TABLE ACCESS STORAGE FULL), which is good and expected with Exadata.

  • Solaris 10  - After installation read only file system

    Dear All,
    I have installed the Solaris 10 on my x86 system with out any problem. The installation was completed successfully. I have followed the installation instructions that are mentioned in the following link.
    http://docs.sun.com/app/docs/doc/817-0544/6mgbagb19?a=view
    I am facing a different problem. I am not able to create even a single file / sub-directory on any of the existing directories. It always says READ ONLY file system can not create firl / directory.
    Please help me how to resolve this issue.
    Thanks in advance.
    Regards,
    Srinivas G

    What do you get for 'svcs -xv' output?
    Darren

  • Crashes and read-only file systems

    Notice: I apolgize for the long post, I've tried to be as thorough as possible.  I have searched everywhere for possible solutions, but things I've found end up being temporary workarounds or don't apply to my situation.  Any help, even as simple as, "have you checked out XYZ log, it's hidden here", would be greatly appreciated.  Thanks
    I'm not sure what exactly caused the issues below, but they did start to happen within a day of running pacman -Syu.  I hadn't run that since I first installed Arch on December 2nd of this year.
    Setup:
    Thinkpad 2436CTO
    UEFI/GPT
    SSD drive
    Partitions: UEFISYS, Boot, LVM
    The LVM is encrypted and is broken up as: /root, /var, /usr, /tmp, /home
    All LVM file systems are EXT4 (used to have /var and /tmp as ReiserFS)
    The first sign that something was wrong was gnome freezing.  Gnome would then crash and I'd get booted back to the shell with all filesystems mounted as read-only.  I started having the same issues as this OP:
    https://bbs.archlinux.org/viewtopic.php?id=150704
    At the time, I had /var and /tmp as ReiserFS, and would also get reiserfs_read_locked_inode errors.
    When shutting down (even during non-crashed sessions) I would notice this during shutdown:
    Failed unmounting /var
    Failed unmounting /usr
    Followed by a ton of these:
    device-mapper: remove ioctl on <my LVM group> failed: Device or resource busy
    Nother of these errors had ever appeared before.
    After hours of looking for solutions (and not finding any that worked) I was convinced (without any proof) that my Reiser file systems were corrupt and so I reformatted my entire SSD and started anew - not the Arch way, I know   I set all logical volumes as EXT4.
    After started anew, I noticed
    device-mapper: remove ioctl on LVM_SysGroup failed: Device or resource busy
    was still showing up, even with just a stock Arch setup (maybe even when powering off via Arch install ISO, don't remember).  After a lot of searching, I found that most people judged it a harmless error, so I ignored it and continued setting up Arch.
    I set up Gnome and a basic LAMP server, and everything seemed to work for a couple of hours.  Soon after, I got the same old issues back.  The System-journald issue came back and per the workaround on https://bbs.archlinux.org/viewtopic.php?id=150704 and a couple other places, I rotated the journals and stopped journald from saving to storage.  That seemed to stop THOSE errors from at least overwhelming the shell, but I would still get screen freezes, crashes, and read-only file systems.
    I had to force the laptop to power off, since poweroff/reboot/halt commands weren't working (would get errors regarding the filesystems mounted as read-only).
    I utilized all disk checking functions possible.  From running the tests (SMART test included) that came as part of my laptop's BIOS to full blown fsck.  All tests showed the drive was working fine, and Fsck would show everything was either clean, or
    Clearing orphaned inode ## (uid=89, gid=89, mode=0100600, size=###
    Free blocks count wrong (###, counted=###)
    Which I would opt to fix.  Nothing serious, though.
    I could safely boot back into Arch and use the system fine until the system decides to freeze/crash and do the above all over again.
    The sure way of recreating this for me is to run a cron job on a local site I'm developing. After a brief screen freeze (mouse still moveable but everything is otherwise unreponsive) I'll systemctl status mysqld.service and notice that mysqld went down.
    It seems that it's at this point my file systems are mounted as read only, as trying to do virtually anything results in:
    unable to open /var/db/sudo/...: Read-only file system
    After some time, X/Gnome crashes and I get sent back to shell with
    ERROR: file_stream_metrics.cc(37)
    RecordFileError() err = 30 source = 1 record = 0
    Server terminated successfully (0)
    Closing log file.or_delegate.h(30)] sqlite erro1, errno 0: SQL logic error or missing database[1157:1179
    rm: cannot remove '/tmp/serverauth.teuroEBhtl': Read-only file system
    Before all this happened, I was using Arch just fine for a few weeks.  I wiped the drives and started anew, and this still happens with just the minimal number of packages installed.
    I've searched for solutions to each individual problem, but come across a hack that doesn't solve anything (like turning off storing logs for journal), or the solution doesn't apply to my case.
    At this point, I'm so overwhelmed I'm not even sure where exactly to pick up figuring this issue out.
    Thanks in advance for any help

    Did this occur when you booted from the live/install media?
    What is your current set up? That is, partitions, filesystems etc. I take it you have not yet reinstalled X but are in the default CLI following installation?
    If turning off log storage didn't help, reenable it so that you may at least stand a chance of finding something useful.
    What services, if any, are you running? What non-default daemons etc.?
    Does it happen if you keep the machine off line?
    Have you done pacman -Syu since installation and dealt with any *.pacnew files?
    Last edited by cfr (2012-12-26 22:17:57)

  • Server read lock request timed out in MDM 7.1 server

    Hi,
    I have a issue regarding the MDM 7.1 server which is on windows 2003 server and Database as Sql server 2005.
    The issue is when i am trying to load the MDM server from the MDM console it is popping out the error message as "Server read lock request timed out"
    when i restart the server and try to mount the MDM server it is getting mounted but after a while again it popping out the error message.
    i saw few log's at batabase and o/s but no luck, Is there a way to solve this issue.
    Thanks
    Phani Ram

    Hi Phani,
    I am not quite sure so just have a look at guide u201CGood to Knowu201D Topics for a Smooth SAP NetWeaver MDM 7.1 Implementation
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/70b0caa1-92e5-2c10-c687-a8d05e778e59?quicklink=index&overridelayout=true
    Page no: 21/96 Example 3: Request for a server/repository read lock timed out where it is said that with MDM 7.1, lock attempts time out in 2 minutes to prevent Consoles from locking up for long times. This is not an error and does not require server to be restarted.
    So please go through complete section 5.6 MDM Server Client Requests
    Hope it helps..
    Regards,
    Mandeep Saini

Maybe you are looking for