I want to receive and send data in ASCII how can I do? (Have the code)

I use my program connect to server (the server is .exe file) after I connect in ms-dos mode I want to send the command from client to server but nothing is happen such as I want to send MOVE 50 it means move 50cm nothing is back(may be because I haven't convert it to ASCII first) How can I change mycode to read and wrtie ASCII code?
public class proxy_server {
    /** Creates a new instance of proxy_server */
    public static void main(String args[]) throws IOException {
            Socket sock=null;
            PrintWriter out=null;
            BufferedReader in=null;
            sock = new Socket("localhost", 3000);
            out=new PrintWriter(sock.getOutputStream(),true);
            in=new BufferedReader(new InputStreamReader(sock.getInputStream()));
            BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
            String userInput;
            while(( stdIn.readLine()!=null)){
                userInput=stdIn.readLine();
                out.println(userInput);
                System.out.println("echo"+in.readLine());
            out.close();
            in.close();
            stdIn.close();
            sock.close();
}

we usually should use a blank-line-check as an exit condition.Certainy not 'usually'. See below.
I was just talking about a primitive stdin input on
console.But nobody else was, especially the OP.
Simple null check on readLine while loop often causes
confusion among Java newbies becuase they can't exit
the program.
If and only if you define your operating instructions so that pressing ENTER is the way to exit the program, you would include the blank line check. Not otherwise, and certainly not 'usually'.
Otherwise they can always type Ctrl/Z or Ctrl/D to exit the program. And that's the correct way to clear up the confusion. Terminating the loop on a blank line just adds to the confusion

Similar Messages

  • Droid X receives and sends calls but neither party can hear

    My Droid X would receive and send calls but nether party can hear each other, however I can send dial tones on the line.  The receiving side can not send tones.  Resetting to factory is dramatic.  What can I do to fix this.  Thanks!

    Sounds like the software could be corrupt, how is hard reset dramatic?
    It is either hardware or software, you won't know until you eliminate one.

  • I have a $10 gift card balance on my Apple ID but when I try to rent a movie it wants me to use my debit card. How can Make it use the iTunes credit?

    I have a $10 gift card balance on my Apple ID but when I try to rent a movie it wants me to use my debit card. How can Make it use the iTunes credit?

    Hi ...
    Select None for payment method > iTunes Store: Changing account information
    Be aware, an auto renewing subsciption by require a credit card.

  • Since ios 6 each mail i receive it send me a message how can i stop that ??

    since ios 6 each email i receive it send me a message ... how can i stop that please ....

    I tried to send it through gmail and the acct is  a POP acct
    I'm not concerned about sending to the long address list. I just can't get the email and window that says "cannot send emai using the server..." to go away. The default must be "retry", because although I cannot see the choices at the bottom of the window if I hit return it trys again... and then of course comes back with the very long pop up window that I cannot see the bottom of so I can tell it to quit trying...

  • Replacement of iPad-3 to iPad-4? I want to know more about policy within 14 days the date of purchase,how can i replace with the ipad4? ?

    Hi
    I want to know the policy of replacement under 14 days of purchase iPad-3. I bought ipad-3 3 days ago before the launch of iPad-4. I want to know more about 14 days policy. I bought my iPad-3 not from the apple store , but it was the authorized apple center. If they are not the part of you so why you giving the license to sell your product. Is this not a cheating? We are purchasing Apple product. We have trust on Aplle thats why we purchase from them.
    I bought Apple's iPad-3 not samsung or nokia iPad-3 so Apple is responsible not ANYONE. Because Apple dint announce anything before neither they cut off their prices on iPad-3.
    Now my point is this i want to know more about 14 days exchange policy who bought their ipad-3 within 14 days from the dealers.
    Now I want to replace my iPad-3 with iPad-4 because i bought just 3 days before new one is Launch.Same price less Technology 3 days before woowwwwww....
    New CEO Tim Cook is taking gr8 step for its loyal customers. Tim are you working with samsung now? How much money they pay you to destroy Apple?

    I have rang my local apple store this morning and they have told me that they will swap out the ipad 3 to the ipad 4. I have the 4G version and im in the uk im sure that this may be the reason why they will for me due to 4g networks in uk not being compatible with the ipad 3..
    Just ring your local store they will im sure help you with all the info

  • My restrictions are on and I didn't turn them on.  The code is not the one I use to unlock my ipad.  How can I find out the code to turn off my restrictions and why did it turn on?

    My restrictions are turned on. I didn't turn them on.  The only code I've used on my ipad is to unlock it and that code won't work on my restrictions.  How do I turn off restrictions and prevent them being turned on again?

    The only option is to wipe the device clean and restore it to factory settings.  Hope you have a backup.
    Follow the instructions in  iOS: How to back up your data and set up your device as a new device http://support.apple.com/kb/HT4137 to restore the device to factory settings.
    Once you have setup the device as a new one, you can then sync it back with your iTunes account and all your music, apps, contacts and any other content sync'ed with iTunes will be loaded on the device. Any content that is stored only on the device and not sync'ed with iTunes, like app logins or data, will be lost during this process. Be forewarned that this is a long process and can take a couple of hours or more to complete. This can be painful, but it is necessarily so to prevent users from working around the security settings. After the restore is complete, you can setup a new Restrictions passcode. Make a note of the passcode to avoid this situation in future.
     Cheers, Tom

  • How can I automatically have the XRAID turn on and off at a specific time?

    Hi Everyone,
    I was wondering if anyone can help me figure out how to turn on and off the XRAID at a specific time. My electrical bills are crazy. Is there a way to get this done?
    Thanks,
    Jorge

    Hi Everyone,
    I was wondering if anyone can help me figure out how
    to turn on and off the XRAID at a specific time. My
    electrical bills are crazy. Is there a way to get
    this done?
    Thanks,
    Jorge
    I think turning the RAID on and off periodically is a bad idea. But if you really really really want to do this ....
    Connect the xserve raid to a 'metered power strip such as those provide by APC. you can telnet to the power strip via the network to power off individual port)
    write a script (run on the xserve or powermac that the RAID is connected to (direct or via switch)
    0) quit application (issue a quit command or if the application have a stop command (example databse can be stopped)
    1) unmount volume (must)
    2) issue a telnet command via expect script to control the power strip to power off the array.
    If you have java cli access to the array (see alienraid.org).(I have not tried this before.)
    http://alienraid.org/article.php?story=xserveraidtools12&query=command
    You can issue a command to execute the RAID admin shutdown command.
    Put the master script into a unix cron job.
    macbook pro   Mac OS X (10.4.7)   typing this on a white box pc

  • Could not activate cellular network. You are not subscribed to a cellular data service. How can I connect to the Internet?!

    I am trying to connect to the Internet when I am not in a wifi spot and I cant get it on... Any ideas? All my settings are switched on and same as mums phone which works. I am on Vodafone payg with an iPhone 4S. Thanks!

    Where did you get the phone ?    If you are on payg are you sure the phone isn't locked to another carrier ?

  • My six year old set up the restrictions code on my iPad and he doesn't remember the code he used. How can I find out the code. I already tried reseting the iPad and it did not work.

    How can I retrive the passcode for Restrictions? I already tried reseting my iPad to factory settings but did not work.

    I believe there is a way to reset the settings only, but I'm not sure if that applies to restrictions. Maybe there is a way on the computer?

  • TS3276 Help in setting Apple Mail to receive and send mail via Yahoo mail service

    I would appreciate help in setting up Apple Mail to receive and send e-mails via Yahoo.   Thank you

    Sorry,
    Have you tried the connection doctor? In Mail menu bar under Window connection doctor, this will usually let you know where the problem might be.
    http://support.apple.com/kb/TS3276  Read thru this as well.

  • I got the new iPhone5 back in Dec, I hooked it up to my computer for the 1st time this wk.  It deleted all new data added since Dec (notes,contacts,texts,pics, info in apps) and reverted back to all my old data.  How can I retrieve all the lost data??

    I got the new iPhone5 back in Dec, I hooked it up to my computer for the 1st time this wk.  It deleted all new data added since Dec (notes,contacts,texts,pics, info added to apps) and reverted back to all my old data (literally uploaded all of my old texts and 1400 old pics and deleted anything new).  How can I retrieve all the lost data?? Please help!!

    SkyDaughter29 wrote:
    My current situation: I have soooo many texts on my iphone and I haven't deleted many because I need the information contained in them for future reference and for legal purposes.  I would really like to find a means and way to save them other than on the phone itself. I've done searches for various apps yet I'm not finding what I think I would need.  It appears Apple does not sync the texts between the iphone and my MacBook Pro.
    Try the computer apps PhoneView (Mac) or TouchCopy (Mac & PC):
    http://www.ecamm.com/mac/phoneview/
    http://www.wideanglesoftware.com/touchcopy/index.php
    Best of luck.

  • Iphone 4s-when wifi is off and I am away from my home connection can I receive and send texts and text messages?  I want to keep my wifi off to limit data (email etc) to when I want to check it.  Cellular is roaming"voice only" it says.Can I get texts?

    When my wifi is off and I'm away from my home connection - it shows wifi off (unless I turn it on to check my email etc.) - and in the settings cellular it shows "voice only". Will I be able to receive and send texts in those settings?  Or check voicemail.  I had wanted to keep my email from coming in all the time and only want to check it periodically - so I turn ON my wifi when I want to check my email.  But when my wifi was off away from home- I hadn't seemed to be getting my texts.  So- do I need to keep wifi roaming connected when away from home to receive and send my texts in real time.  (which is what I want) or am I still able to send and receive texts with my wifi off when I'm away from home.  (When I'm home I am connected to my home data plan automatically through wifi and I get texts when I'm home - but I'm thinking I'm not getting texts in real time - is it because my wifi is off when I'm away from home?  My cellular shows voice only when my wifi is off away from home.  Am I doing it right to receive and send texts away from home?  Or do I need to open up the wifi in order to receive and send text messages.  I know that I would need to turn on wifi roaming - which will use data - for email checking or sending - as well as to use browsing apps and now I'm guessing to receive voice messages I may have missed?  So do I need wifi on to receive texts too?  Thank you - GregorySC

    Hello GregorySC,
    In order to send and receive SMS or MMS messages, you will need to have an active cellular data or Wi-Fi connection.
    You will need these to send and receive iMessages:
    An iPhone, iPad, or iPod touch
    iOS 5.0 or later
    A cellular data connection or a Wi-Fi connection
    A phone number or Apple ID registered with iMessage in Settings > Messages
    iOS: Troubleshooting Messages
    http://support.apple.com/kb/TS2755
    Cheers,
    Allen

  • Cannot Lock and Send data to an Essbase cube

    Hi all,
    One of our customer is executing a Macro script to lock and send data to the essbase cube from an excel sheet.
    They reported that in several cases where users will submit their data, and later discover that their changes are not in Essbase.
    The calls to EssVRetrieve (to lock the blocks) and EssVSendData are both returning successfully and there is no error message received while executing the above macros.
    I reviewed the application log file and found the following message:
    [Mon Nov 24 18:59:43 2008]Local/Applicn///Warning(1080014)
    Transaction [ 0xd801e0( 0x492b4bb0.0x45560 ) ] aborted due to status [1014031].
    I analysed the above message and found the user is trying to lock the database when already a lock has been applied to it and some operation is being performed on it. Because of that the transaction has been aborted. But customer says no concurrent operation is being performed at that time.
    Can anyone help me in this regard.
    Thanks,
    Raja

    The error message for error 1014031 is 'Essbase could not get a lock in the specified time.' The first thought I have is that perhaps some user/s have the 'Update Mode' option set in their Essbase Options and thus, when they are retrieving data, they are inadvertantly locking the data blocks. If that is the case, you will probably see this issue sporadically as the locks are automatically released when the user disconnects from Essbase.
    To make it stop, you will have to go to every user's desktop and make sure they have that Essbase Option turned off. Further, you will have to look at any worksheets they may use that may have an Essbase Option name stored on it. The range name is stored as a string and includes a setting for update mode. Here is a sample that I created for this post where I first turned 'on' update mode and then turned 'off' update mode:
    A1100000001121000000001100120_01-0000
    A1100000000121000000001100120_01-0000
    Note the 11th character in the first string is '1' which indicates that Update Mode is 'on'; in the second string, it is 'off'.
    This behavior, particularly with update mode, is the only one of the behaviors that I disliked in Excel and pushed me to design our Dodeca product. In Dodeca, the administrator controls all Essbase options and can either set individual options to the value they want or they can allow the user to choose their own options. Most of our customers do not allow the user to set update mode.
    Tim Tow
    Applied OLAP, Inc

  • How to receive and send V/A signal in one host?

    The sample code VideoTransmit.java,sames only can send the V/A signal over network,but the sending host cannot receive the signal.
    I hope receive and send signal in one host,what should I do?
    s.

    Now,the problem is ,how to send and save the live stream in one host?I hope save the stream to a media file,like *.dat,etc.
    Of course,the host user can receive the stream sending by himself.
    s.

  • How do i clear the receiver and send buffer?

    I am trying to communicate with the Votsch 3050 thermal chamber, with LabVIEW as the control software via serial RS232. In sending the required ASCII strings, there was no response from the chamber, yet no error.
    The manufacturers indicate clearing the receive and send buffer using the the "PurgeComm(HANDLE hFile, DWORD dwFlags)" function in C, but offer no LabVIEW support.
    Does any one have any ideas on how i can do this using LabVIEW? Any Information or VIs would be greatly appreciated.

     @dsbuxi I have worked with many patient monitors. They often work in a client server setup. Data is not sent before you request it. And the communication has to follow a certain protocol. Your job will be to implement this protocol in Labview.  This is not too hard, but it requires some reading to understand the protocol. I am not able to send you any code, but feel free to ask if you need some help regarding the protocol 
    And you may have to order or make a custom cable. But you will also find this information in the protocol description. Good luck
    Message Edited by t06afre on 01-07-2009 09:03 PM
    Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
    (Sorry no Labview "brag list" so far)

Maybe you are looking for

  • How to find out MTS or Dedicated

    I am running Oracle 8.1.7 on Sun Solaris. I have set the following in init.ora file. mts_dispatchers="(protocol=tcp)(dispatchers=4)(connections=1000)" mts_servers = 3 When I query the server column of v$session table I find DEDECATED for each user. D

  • Cpufrequtils: Why should I care, and acpi-cpufreq vs. p4_clockmod

    I'm a cpufrequtils newbie. In the years I've been running Arch on my laptop, I've never set it up. I wonder, why should I care about cpufrequtils? What should I know about the technology as a laptop user? Does the fact that I rarely unplug make a dif

  • CS4 freezes when building Blu-Ray

    Trying to build an ISO for a Blu-Ray project in Encore CS4 and whenever it transcodes the large file (6GB) it freezes when less than 1/4 of the way in. I have two files both exactly the same codec (H.264 1920x1080) and the first one is way smaller an

  • Why does Adobe Flash Player block me from using Firefox?

    Every time I try to use Firefox, Adobe Flash Player blocks me from doing so. I get continual messages that keep reappearing: """""""Adobe Flash Player 11.5 r502 has stopped working. A problem occurred to make the program stop working correctly. Windo

  • Near with stopwords

    Hi, we have an unexpected behavior with the command NEAR with a stopword inside. Example: select * from textos where contains(texto,'near((cat,and,dog),0,true)')>0 The error that is returned is: ORA-29902: error in executing ODCIndexStart() routine O