How do I read multiple lines at once with sockets?

I have been trying to teach myself the Java Network stuff and I have come across an issue I can't seem to resolve. I've been modifying the code from the KnockKnockServer and I am trying to send a line like ("Knock Knock \n Who's there? \n Me") to the client, and what happens now is that at each line feed character, I have to type something in to get the next line. I want to output them all at once without having to make the user enter something between each line. Is there some way to do this without writing the client to output three lines at at time?

This is why I wrote InfoFetcher in the first place.
http://forum.java.sun.com/thread.jspa?threadID=759854&messageID=4338547

Similar Messages

  • How to read multiple lines using 'REUSE_ALV_GRID_DISPLAY'

    Hi,
    In ALV report the FM 'REUSE_ALV_GRID_DISPLAY' used.
    EXPORTING
    I_CALLBACK_PROGRAM = W_REPID
    I_CALLBACK_PF_STATUS_SET = 'PF_STATUS'
    I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
    How to read multiple lines in the following dynamic subroutine ?
    I am able to read single value through p_selfld.
    Nut the requirement is to change the values in more than 1 row for a fld (edit mode)
    FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM
    P_SELFLD TYPE SLIS_SELFIELD.
    endform
    Thanks in advance

    You can get the reference by a dirty assign, but this is not offcially supported...
    But if you have some limitations.
    FORM user_command  USING fuw_ucomm LIKE sy-ucomm
                                       fuw_selfield TYPE slis_selfield.
      FIELD-SYMBOLS: <lfs_grid>  type ref to cl_gui_alv_grid,
                                   <lfs_row> type LVC_S_ROW.
      data: li_rows type lvc_t_row.
          assign ('(SAPLSLVC_FULLSCREEN)GT_GRID-GRID') to <lfs_grid>.
          check sy-subrc is initial.
          call method <lfs_grid>->get_selected_rows
            IMPORTING
              et_index_rows = li_rows.
    endform.                    "user_command

  • How do you type multiple lines on a path? (label for top slope of bottle)

    Ill describe the best I can...
    I am making a label that will wrap around the top half of a bottle, the part that slopes to the spout.  Because of this, the label is actually shaped more like an arch so when it goes onto the bottle, it will look more straight.  The top part of the label of course will be a tighter arch than the bottom half.  This is part of why its hard to make things look right.  I know I can bend a line at the same angle and type on it and it looks right but I have a paragragh I have to do this with, about 5 lines worth.  I dont want to have to make a different path line for each one because that would be a nightmare to get each line perfect with each other.  Is there a way to do the "type on a path" to work with multiple lines at once?

    Scott Falkner wrote:
    You can't. Each line of text requires an explicit path. You could draw the top line and the bottom line, then make a three-step blend between the two. Expand the blend then link the paths so that text from path 1 flows to path 2, and so on. In the example below each path is linked to the one below. I only needed to paste text into the top path. I was able to link to each following path by clicking on the red + at the end of the previous path, then clicking on the path below.
    You could also design the label flat and use a distortion envelope or Warp effect to bend it. This is how I have done such labels in the past. That method requires more experimentation, but makes edits easier.
    That seems to be something that might work out.  How do you separate each of the strokes from the blend to make them typable though?

  • From my music how do i move multiple songs at once to a playlist

    From( My Music) how do I move multiple songs at once to a playlist.
                                        Thanks

    Your issue has nothing to do with Apple networking. You may get better results in getting a solution if your post your issue to the iTunes area of the Apple Support Communities.

  • How to do the multiple-line String at JList?

    hey everyone,
    i want to create a JList have to display multiple-line string.
    i have use String a="text1"+"\n"+"text2" inside my JList...
    the "\n" change to a sequare box...
    how cum like that.................??
    i need ur kindly helping...

    Because the default renderer for a JList element is a
    JLabel, and that is how JLabel behaves. The question
    "how to do a multiple-line JLabel" has been asked
    hundreds of times in this forum, search for that.i have search for it already but i no get it..anything!
    so, can u give me the url for me? thank you!

  • Reading Multiple lines in a file Using File Adapter

    Hi All,
    Iam new to this technology.How to read multiple lines in a file using file adapter.Brief me with the methodology.

    I didn't look at anything else but if you want to write more than one line ever to your file you should change this
    out = new FileOutputStream("Calculation.log");to this...
    out = new FileOutputStream("Calculation.log",true);A quick look at the API reveals the follow constructor FileOutputStream(File file, boolean append) append means should I add on the end of the file or over-write what is there.
    By default you over-write. So in our case we say true instead which says add on to what is there.
    At the end of that little snippet you shoudl be closing that stream as well.
    So where you have
    p.close();You should have
    p.close();
    out.close();

  • Itunes - how do i select multiple line items not in sequence ?

    itunes - how do i select multiple line items not in sequence ?

    Hold down the Command key and click each in succession.
    To extend the selection across items that ARE contiguous, use the Shift key.

  • How to create a multiple-line TextBox in a jfx script?

    How to create a multiple-line TextBox in a jfx script?
    Or
    How to use the Swing component JTextArea in a jfx script?
    Please post a brief code segment.
    Thanks,
    Asghar

    This supports two way binding between JavaFX and Java and also cut and paste.
    Enjoy.
      * MyTextArea.fx
      * Created on Dec 14, 2008, 7:23:49 AM
    package twifxer.components;
    import java.awt.event.KeyEvent;
    import java.awt.event.KeyListener;
    import java.awt.Font;
    import javafx.ext.swing.SwingComponent;
    import javax.swing.JComponent;
    import javax.swing.JTextArea;
    import java.awt.Color;
      * @author Steven Herod
    public class TweetTextComponent extends SwingComponent{
         var myComponent: JTextArea;
         public var length: Integer;
         public var readText:String;
         public var text: String on replace{
             myComponent.setText(text);
         public var toolTipText: String on replace{
             myComponent.setToolTipText(toolTipText);
         public override function createJComponent():JComponent{
             translateX = 15;
             translateY = 5;
             var f:Font = new Font("sanserif",Font.PLAIN, 11);
             myComponent = new JTextArea(4, 33);
             myComponent.setOpaque(false);
             myComponent.setFont(f);
             myComponent.setWrapStyleWord(true);
             myComponent.setLineWrap(true);
             myComponent.addKeyListener( KeyListener{
                 public override function
                 keyPressed(keyEvent:KeyEvent) {
                     if (keyEvent.VK_PASTE == keyEvent.getKeyCode())
                         myComponent.paste();
                 public override function
                 keyReleased( keyEvent:KeyEvent) {
                     var pos = myComponent.getCaretPosition();
                     text = myComponent.getText();
                     myComponent.setCaretPosition(pos);
                 public override function
                 keyTyped(keyEvent:KeyEvent) {
                     length = myComponent.getDocument().getLength();
             return myComponent;
    }

  • How do I delete multiple items at once instead of one at a time?

    How do I delete multiple items at once instead of one at a time? I have several duplicate items in my library and would like to delete the duplicates. Thanks!

    You can select multiple items using shift to select a range and control to add or remove items from it.
    Regarding duplciates, Apple's official advice is here... HT2905 - How to find and remove duplicate items in your iTunes library. It is a manual process and the article fails to explain some of the potential pitfalls.
    Use Shift > View > Show Exact Duplicate Items to display duplicates as this is normally a more useful selection. You need to manually select all but one of each group of identical tracks to remove. Sorting the list by Date Added may make it easier to select the appropriate tracks, however this works best when performed immediately after the dupes have been created.  If you have multiple entries in iTunes connected to the same file on the hard drive then don't send to the recycle bin. This can happen, for example, if you start iTunes with a disconnected external drive, then connect it, reimport from your media folder, then restart iTunes.
    Use my DeDuper script if you're not sure, don't want to do it by hand, or want to preserve ratings, play counts and playlist membership. See this thread for background. Please take note of the warning to backup your library before deduping, whether you do so by hand or using my script, in case something goes wrong.
    (If you don't see the menu bar press ALT to show it temporarily or CTRL+B to keep it displayed)
    tt2

  • How to handle the multiple line items in the Inbound idoc FM

    Hi ,
    Can any body give me how to handle the multiple line item in the idoc when we reprocessing it from workitem....
    Thanks in Advance,,,,
    Regards,
    Bharani

    Hi ,
    Can any body give me how to handle the multiple line item in the idoc when we reprocessing it from workitem....
    Thanks in Advance,,,,
    Regards,
    Bharani

  • How do i read complete line from a text file in j2me?????

    how do i read complete line from a text file in j2me????? I wanna read file line by line not char by char..Even i tried with readUTF of datainputstream to read word by word but i got UTFDataFormatException.. Please solve my problem.. Thanks in advance..

    That is not my problem . i already read it char by char.. i am getting complete line..But this process is taking to much time..So thats why i directly wanna read complete line or word to save time..

  • StringTokenizer to read multiple lines

    I've been struggling to make my program to read multiple lines from the input text
    input5.txt:
    -.1 -2.3 -45.678 -90
    .1 .23 .45678 .90
    1 2.3 4.56
    0
    and the program will stop reading when it sees 0 in the line. What i got was a nullPointerException, it reads a single line fine, but when it comes to multiple lines, it messes up. Heres a portion of my program code:
    while (info1 != null && !end)
         tokenizer = new StringTokenizer(info1, " \t\r\n");
         while ((info1 = stdin.readLine()) != null && info1.length() != 0)
              if (tokenizer.hasMoreTokens())
                   // temp is a dummy String to help for counting limit.
                   temp = tokenizer.nextToken();
                   dummy [limit] = temp;
                   limit++;
         numbers = new float [limit];
         while (count < limit)
              while (tokenizer2.hasMoreTokens() && num1 != 0.0 && num1 != 0)
                   num1 = Float.parseFloat(dummy[count]);
                   numbers[count] = num1;
                   count++;
         end = true;
    }

    You need to move the "new StringTokenizer" into the following while loop
    John

  • How do i read new line char in jtextarea.getText()?

    guys, how do i read new line character in jTextArea.getText()? i'll appreciate ur help tnx..:))

    Use a StringRead, then you can treat the text file a file.

  • How do you have multiple apple id's with one itunes

    how do you have multiple apple id's with one itunes

    I have multiple IDs and use the single computer sharing itunes. By 'sharing' I mean we open the pc, open itunes and log in with our individual ID as required.
    While Im logged in I plug in  my device. I transfer my purchases from my device as per the file menu (not the check for auto downloads). I move them as required to whichever playlist I like.
    Then when my son wants to use itunes or update his device, he logs in, plugs in his device, transfers purchases from his device, puts whatever music he wants into his playlist and/or drags direct to the device regardless of who purchased it and then syncs.
    Im not sure how it works associating the pc with only one ID or all that other business- I know I don't fiddle with any of that.

  • How can I have multiple WINDOWS (NOT tabs) with INDEPENDENT content?

    How can I have multiple '''windows''' (''not ''tabs) with '''independent''' content?
    I used to be able to open separate windows with Firefox, and the content could be completely different in each window. No matter what I did in any window, no OTHER window open at the time, nor any of the content therein, was affected. This is no longer the case and it is extremely frustrating for me.
    I do ''not ''like tabs and do not use them. I prefer multiple windows plus I am so used to using them, for so many years now! But with v9.0.1 I suddenly can no longer do what I've always done with my browser without this aggravating problem constantly reminding me that I can't have what I want in firefox anymore.
    Or can I? Does anyone have a solution I don't realize exists?
    Thanks,
    Sowelu

    AppleScriptObjC can use pretty much everything in the Cocoa API, so yes, it is possible.
    Note that a view is not the same as a window, and a window can have multiple views. There are also many ways to implement "tabs";  take a look at some of Apple's applications - they use various mixtures of toolbars, checkboxes, and radio buttons, for example.  An application such as this will be a lot more involved than what you have done so far though, using custom classes and subclassing existing ones, so be prepared to do a lot of reading and researching.

Maybe you are looking for

  • Windows 8.1 Prof and Hyper-v Server 2012 R2 core export snapshot hile VM is running

    Hi, I have ugraed my client to Windws 8.1 prof. After some digging i found out that it was posible to export a snapshot(if you have multiple snapshot) while using Hyper-v manager in windows 8.1 to a Hyper-v 2012R2 server. In my old pc win 7 prof i ha

  • How do you connect iPad to canon printer

    How do you connect a canon wireless printer up to a iPad 2nd generation?

  • Oracle BPM for Network Management Projects

    Has anybody used Oracle BPM for network management projects with millions of events? Can Oracle BPM handle it?

  • Pop-ups

    I continue to get an error message poping up, it says, AppleMobileDeviceHelper has stopped working. It is really annoying, can anyone assist me in getting this resolved?

  • Tutorial 7: Compiling Applications

    C:\medrec_tutorial\src\physicianEar>ant -f mybuild.xml Buildfile: mybuild.xml build: [java] Loading source file C:\medrec_tutorial\build\physicianEar\physSessio nEjbs\com\bea\medrec\controller\PhysicianSessionEJB.java... [java] Constructing Javadoc i