CANT receive data via a network, help me please

Hi, I am not as newbie as I look like to.
I am trying to receive data through a network. The problem is that I dont know the file size, so I kept reading until reaching the end of file and the save it to a file. The problema is that I am never geting the -1 result from the read method.
Now, I noticed that the -1 is returned when I close the DataOutputStream. So thats okay. The problem is that the sender is not make in java, but on pocketBuilder. And I cant ask for the client to close an outputStream. So Is there any way to just read the data without knowing the number of the bytes to receive and doesnt waiting for the end of the stream.

When the number of bytes read is less than the array
lengthThat doesn't necessarily mean you're at the end of the data.
Any other wahy, maybe a timer (if is not receiving
any byte for 20 seconds then cut the conexion?)Again that doesn't necessarily mean you're at the end of the data.
There is no way to know you're at the end of the data without either an application protocol containing the length, or a socket close at the sender.

Similar Messages

  • Receiving data via 802.15.4 radio

    Hi,
    I am familiar with using a bluetooth radio to receive data wirelessly through the serial port using VISA in LabVIEW. However due to the range limitations of my bluetooth radio, I'd like to have a go at receiving date via from an 802.15.4 radio. Has anyone any experience doing something like this and is it possible using VISA and a serial port? Presuming I know the data packet format, it should be ok right..?
    Strokes

    Lewis G wrote:
    Hi Strokes,
    Do you plan on buying a third party 802.15.4 wireless device that connects to your computer through the serial port?  What hardware do you intend to use?
    I assume you wish to use your existing code that was designed for the Bluetooth dongle. Are you communicating using a serial protocol or Bluetooth protocol (Bluetooth or Serial VIs)?
    What is your current setup?  Do you have a Bluetooth device that connects to your PC via serial? What hardware do you have sending and receiving the data?
    Have you seen the NI Wireless Sensor Networks and have you thought about Using LabVIEW with TCP/IP and UDP?
    Kind Regards
    No I plan on using a Shimmer device (see here) which as a 802.15.4 radio on it's circuit board to communicate to a laptop via serial port.
    I'm not set on using the existing code as used with the bluetooth radio on the Shimmer, but if it will reduce the workload then yes of course I will. The existing code currently uses serial protocol so I guess I could modify the existing code?
    My current setup is: I have a Shimmer (wireless sensor, accelerometer in this case) that has both a bluetooth radio and 802.15.4 radio. Due to my application needs, I would like to transmit data to the serial port via the 802.15.4. There is existing code which allows the Shimmer to communicate with the serial port using Bluetooth radio.
    I'm not looking for code or anything, just wanted to know how to go about it and if I could use VISA which I'm fairly familiar with.
    Thanks,
    Strokes

  • Iphone 4 only receiving sms from certain networks- help?!!!!

    Iphone 4 is only receiving sms from certain networks - help?!!!

    Have you contacted your carrier to report the problem? This is not (and can not be) a problem with the phone. It's a problem with your carrier and/or the way they have your service provisioned.

  • My motor receives data via a serial connection, but it won't move. What am I doing wrong?

    Hello everyone,
    as the title says, I am trying to use a motor called "MP285" by Sutter Instruments via LabView. The control unit of this motor only has a RS232-output, but I use a Serial-to-Usb-Adapter to connect the device to the PC.
    My problem is the following:
    I tried to perform a basic Input/Output test by using the Ni MAX an sending ASCII strings to the control unit (after configuring it according to the reference manual), which worked fine. I also used the "jabber"-function of the control unit to send an output string to the PC and was also able to read that string from the buffer. Besides, when I used a LabView-VI to send a command via VISA Write, it also appears on the display of the control (at least the ASCII letters).
     Accordingly, I assume that the Serial-to-USB-adapter does work. Is that for sure, or can the adapter evoke any other problems?
    However, when I try to use the shipped controlling software, the motor won't work. Furthermore, I contacted the customer support and they sent me some VIs and a LabView-Project, which was tested by the company. Unfortunately, it did not work for me. The motor wouldn't move, when I sent the command, although the LabView-interface indicates that there the connection between PC and controller has been established. As the program has many features and I only need a command to move the motor, read the position and set the origin, I tried to build my own VI. I had a look at some basic VIs for motor control and referred to the manual.
    As it seems, the controller uses data streams of full bytes (8 bits, not ASCII) in Big Endian for its strings (I copied the information at the bottom of this text). Thus, I tried to concatenate particular strings to send it via VISA in the correct form (see attached). Do I have to convert the "m" into hexadecimal explcitly? I looked up "Convert ASCII to Hexadecimal", but when I try this, the output string does not change.
    However, when I send this string to the controller in normal mode, nothing happens . When I activate the Input/Ouput test (see above), there is a m displayed on the controller unit. So I guess, I am messing up the command structure. Can anybody help me please?
    Kind regards
    PS: Sorry for cleaning up the diagramm..
    PPS: For some reason, I could not attach the VI because " The contents of the attachment doesn't match its file type". So, I changed the name in "-vi" instead of ".vi" as suggested by a forum user. Hope this works for you!
    Excerpt form the reference manual:
    General Information:
    "Command requests are single bytes followed by optional parameters and terminated by a
    carriage return (CR, 0Dh). The data stream consists of full bytes (all 8 bits — not ASCII.
    The lowest order byte (for example, of the four bytes encoding the X coordinate) is the first
    into the controller and is the first out. The default Baud rate is 9600. Commands are
    processed bytewise by interrupt and executed only after the terminating CR is received.
    There are no delimiters within command strings. The controller will reply with carriage
    return (CR, 0Dh) at the completion of normal command processing."
    Command structure:
    Get Current Position      command ‘c’CR 063h + 0Dh
                                               returns xxxxyyyyzzzzCR three signed long (32-bit) integers + 0Dh
    Go To Position                 command ‘m’xxxxyyyyzzzzCR 06Dh + three signed long (32-bit) integers + 0Dh    
                                                returns CR 0Dh
    Setting up for Serial Communication:
    First, use the 9-pin serial port cable provided with the MP-285 to connect the “serial port” of
    your computer to that of the MP-285 controller. Next configure your terminal emulator (e.g.,
    HyperTerminal in Microsoft Windows (9X and above) to the following settings (or their
    equivalent):
    • TTY mode
    • Echo typed characters locally only (do not echo input to the computer serial port back to
    the controller)
    • Baud rate to 9600
    • 8 data bits, no parity, 1 stop bit
    • COM port - set to the port to which you have connected the MP-285 controller
    Solved!
    Go to Solution.
    Attachments:
    MotorTestVI-vi ‏17 KB

    Thank you for your feedback!
    To make this clear: I dont know if the motor MOVES when sending the appropriate command via MAX. That is because I dont know how to enter the binary? command. I only tried to send some string like "dear moto please move" to see if this ASCII string can be displayed on the control unit while running the input-mode (which I described above).
    This works for both, MAX and my Labview-Vi.
    However, these are the I/O traces:
    1. MAX: I sent the string: "Test"
    NI I/O trace:
    viWrite (ASRL25::INSTR (0x026B41E8), "Test", 4, 4) Process ID: 0x0000123C         Thread ID: 0x00001434 Start Time: 16:18:31.599       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
    2. LabView-Vi (I removed everything that followed the first "Visa Write" and added the recommended property node to check if my termination char is correct). I sent string "TEST".
    14.  viOpenDefaultRM (0x065171F0) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.918       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
    15.  viParseRsrc (0x065171F0, "COM25", 4, 25) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.918       Call Duration 00:00:00.002 Status: 0 (VI_SUCCESS)
    16.  VISA Set Attribute ("COM25", 0x3FFF001A, 3000) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.920       Call Duration 00:00:00.020 Status: 0 (VI_SUCCESS)
    17.  VISA Set Attribute ("COM25", 0x3FFF0021, 1200) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.940       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
    18.  VISA Set Attribute ("COM25", 0x3FFF0022, 8) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.940       Call Duration 00:00:00.001 Status: 0 (VI_SUCCESS)
    19.  VISA Set Attribute ("COM25", 0x3FFF0024, 10) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
    20.  VISA Set Attribute ("COM25", 0x3FFF0023, 0) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
    21.  VISA Set Attribute ("COM25", 0x3FFF0038, 1) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
    22.  VISA Set Attribute ("COM25", 0x3FFF0018, 13) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
    23.  VISA Set Attribute ("COM25", 0x3FFF0025, 0) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
    24.  VISA Set Attribute ("COM25", 0x3FFF00B3, 2) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
    25.  VISA Get Attribute ("COM25", 0x3FFF0018, 13) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
    26.  VISA Get Attribute ("COM25", 0x3FFF0038, True) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.000 Status: 0 (VI_SUCCESS)
    27.  VISA Write ("COM25", "TEST", 4) Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.941       Call Duration 00:00:00.001 Status: 0 (VI_SUCCESS)
    28.  VISA Close ("COM25") Process ID: 0x0000154C         Thread ID: 0x00000678 Start Time: 16:24:34.942       Call Duration 00:00:00.110 Status: 0 (VI_SUCCESS)
    Both strings are correctly displayed.

  • Not able to receive data via bluetooth: curve 8520

    hi guys..i have bb curve 8520. i m nt able to receive data from other mobiles or pc via bluetooth. the mobiles & system can be paired with my BB but i cannt receive data from others. also it gives error message FILE TRANSFER SERVICE NOT AVAILABLE

    Hi and Welcome to the Community!
    See this KB:
    KB05409 Transfer a file using Bluetooth technology between two BlackBerry smartphones
    If your other device is non-BB, then substitute, in the KB, the appropriate instructions for your other device. Unless you are on BB OS 6 or 7, do not skip the "Receive Using BlueTooth" step on the receiving BB...nothing will transfer if you do.
    Good luck and let us know!
    Occam's Razor nearly always applies when troubleshooting technology issues!
    If anyone has been helpful to you, please show your appreciation by clicking the button inside of their post. Please click here and read, along with the threads to which it links, for helpful information to guide you as you proceed. I always recommend that you treat your BlackBerry like any other computing device, including using a regular backup schedule...click here for an article with instructions.
    Join our BBM Channels
    BSCF General Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • HT1212 hi...i brought an (American Sprint) i phone 4s from ebay, Now i cant active the phone. can you help me please

    Hi there, I bought an iPhone 4s (sprint USA) from eBay. Now i cant active the phone here in UK. How can I active this phone ? Can anyone help me please.

    Why on earth did you purchase an American iPhone if you knew you were going to activate and use it in the UK?
    If you like in the UK and you want to use the phone in the UK, then buy an iPhone 5 that you can actually use in the UK. 
    So you need to purchase the phone either through one of the phone companies of your choosing by taking out a contract - so EE (Organge and T-Mobile 4G), Vodafone, 3, or o2 or buy an unlocked iPhone directly from the Apple store itself for full price.
    If you buy from e-bay you have no valid warranty if the phone goes wrong, so you won't be able to get the phone fixed in the UK, but you will physically have to go back to the US to get it fixed - iPhone warranty is country specific and NOT worldwide.  If you buy the phone in the UK, then you will have an EU warranty.
    Return the phone to your seller at e-bay for a full refund and start again and buy and iPhone 5 that is unlocked from the UK and then you will be able to activate it.
    Do you have a sim card because you need a sim card to be able to activate a phone and have you connected it to iTunes?
    Unfortunately, not all US models of the iPhone 5 have sim card slots or if they do, they are not all unlocked, so if this is the case with your phone, then you won't be able to activate it here in the UK and there is nothing that you can do.  You will either have an unusable brick or you will have to return you phone to your ebay seller for a full refund.

  • HT4864 i cant receive mails in my account help please

    i can not receive mails in my account

    There is a widely reported server outage in some geographical areas.

  • IPhone 4S - Could not scan for wireless networks - help needed please

    Hi
    Can anyone offer any advice please.
    My 4s has developed an wifi issue. It cant scan for wireless networks My bluetooth is intermittent also.
    I have turned it on/off, rebooted, reset all networks, reset to factory settings, set to airplane mode, set to do not disturb - everything and all to no avail.
    I am under a two year contract with Vodafone and went into their branch at Merry Hill, Dudley today and they failed to help me saying it was nothing to do with them.
    I am at a loss as to what to do. I have not had any accident with my phone and it is still in mint condition.
    Can anyone please offer any suggestions on what to do.
    Many thanks.

    Apple's out-of-warranty policy is a feeble attempt at covering up it's issues and is a clear cut demonstration for their lack of respect for its user base. Their WIFI/Bluetooth dropping issues have been around for several years now and it started within the last 3 IOS updates. Apple engineers acknowledge this problem and don't have a solution yet... this was confirmed at the Genius Bar at their Nashua, NH outlet. My phone is 6 months passed warranty and my Verizon contract isn't up for renewal for another 6 months.
    There are a lot of complaints about this (a LOT), yet Apple continues to stick its head in the sand instead of owning up to providing shoddy hardware and/or glitches software. They certainly don't want to be in the business of replacing phones, so they put the onus on us by charging $200 for a replacement... such a deal for Apple!
    Apple's support communities are basically useless on this subject with a lot of screwy so-called solutions to work around their flaws. I've seen one  fix where you heat up the phone with a hairdryer until the temp warning appears and then refrigerate it for 10 minutes... then BINGO, it's all fixed! Ya right!!!
    Resetting network settings, or all settings (including a complete reset) is ineffective and appears to do nothing more than to further upset Apple users once they realize that they have wasted their time following Apple's so-called fix.
    I just wonder if or when Apple pulls it's collective head out of the sand will they be able to see that their competition has surpassed them by leaps and bounds. There really isn't any good reason to stick with Apple now-a-days since their conscience passed away. Their competition offers superior technology while Apple continues to impress up with new connector technology and placement of their sockets.
    I am finished with Apple and am incredibly sick of their spoon feeding what they want rather than what we want.
    The best way to make Apple improve is to provide them with a taste of their own WIFI/Bluetooth offerings by DROPPING THEM!
    They have abandoned us and have no problem trying to charge us to replace their flawed technology instead of doing the right thing!
    Dale E Alden
    Groton, MA 01450

  • Cant receive or send picture messages

    Hi can someone please help me, I have recently bought the Nokia C3 and I cant receive or send picture messages, can someone please advise.  Thanks

    You need to contact ur operator and ask them to send u MMS & wap and internet settings (Or only MMS), u'll most probably get them via configuration sms, open it, go to options and select "save" phone will ask if to set it as default, select yes. that's it. Try to send Picture message.
    Previous Phones: 6600, 7610, 6230, 6230i, 1100, 1112, N70, N73, N95, N95 8GB, 5800XM, 5230, C5, iPhone 3GS, SE Xperia X10, N900, N8, SE Xperia Arc
    Current Phones: Nokia N9, iPhone 4

  • Cant receive sms, need to change settings

    Hi,
    I have received a Firefox Os phone from geeksphone. Seems pretty good, but it freaked me out today. I realized that I am unable to receive sms. I cant even receive from myself, or gmail(2-step authentication). I have never experienced such problems with othe devices from this office.
    I need to check the sms settings on the phone but cant find them. Can you help me please or provide any hints?
    Thanks.

    Hello, [[Control cellular and data connections and settings on Firefox OS]] should help you with this :)

  • Huge data on slow network

    Hi All!!!
    I have a client which connect to the database through slow network (2Mbit/s) with slow response time:
    PING (10.6.0.5) from 10.1.9.24 : 56(84) bytes of data.
    64 bytes from (10.6.0.5): icmp_seq=1 ttl=124 time=115 ms
    64 bytes from (10.6.0.5): icmp_seq=6 ttl=124 time=109 ms
    64 bytes from (10.6.0.5): icmp_seq=7 ttl=124 time=108 ms
    Once per day client exec sql query which take 15Meg of data from database.
    It's take a lot of time, much more if I transfer this data through FTP.
    Why it's happend?
    May be server can compress data before transfer?
    Help me please.

    Contact the carrier.    

  • Receive data from PayPal

    Hello.
    Assuming that I send data into PayPal (with the use of  "HTML Variables for PayPal Payments Standard"):
    var variables:URLVariables = new URLVariables();
    variables.cmd = "_xclick";
    variables.business = "A8AJGG5PS2GKE";
    variables.upload = "1";
    variables.item_name = "some item";
    variables.amount = "123";
    variables.currency_code = "USD";
    variables.lc = "pl";
    variables.page_style = "PayPal";
    variables.return = "my site";
    variables.re = 2;
    variables.no_note = 1;
    variables.no_shipping = 1;
    variables.notify_url = "[email protected]";
    var request:URLRequest = new URLRequest("https://www.paypal.com/cgi-bin/webscr");
    request.method = URLRequestMethod.POST;
    request.data = variables;
    navigateToURL(request, "_blank");
    Does anyone managed to integrate PayPal IPN - "Instant Payment Notification"-
    (https://www.paypal.com/ipn/) with AS3 in order to receive data from PayPal?
    Could you please show any example of using it.

    My idea is as follow:
    1. .swf on you page sends variables into PayPal
    2. After finishing the payment on PayPal, the customer is auto-redirected to your page ("return" variable)
    3. Customer returns to your page. PayPal does NOT send any payment data there.
    Separately in the background, you receive a form POST from PayPal at a different URL (notify_url variable) - (here resides the php that I added below).
    4. You post back a form with cmd=_notify-validate and all fields you received from PayPal. PayPal responds with a single word VERIFIED or INVALID
    5. If you receive VERIFIED, you can process payment
    This method means that you can easily update for example your MySQL database but unfortunately you have to reload .swf file each time - and that's why it is not a perfect solution in my opinion;
    PS:
    - variables.return   and variables.notify_url must be absolute urls
    - notify_url must also allow anonymous access from outside of your network
    - firewall must be opened to host: notify.paypal.com
    - in your business PayPal account:
    Auto Return = Enabled in account profile
    PDT = Disabled in account profile
    IPN = Enabled in account profile
    - php file:
    <?php
    // read the post from PayPal system and add 'cmd'
    $req = 'cmd=' . urlencode('_notify-validate');
    foreach ($_POST as $key => $value) {
            $value = urlencode(stripslashes($value));
            $req .= "&$key=$value";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, 'https://www.paypal.com/cgi-bin/webscr');
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Host: www.paypal.com'));
    $res = curl_exec($ch);
    curl_close($ch);
    // assign posted variables to local variables
    $item_name = $_POST['item_name'];
    $item_number = $_POST['item_number'];
    $payment_status = $_POST['payment_status'];
    $payment_amount = $_POST['mc_gross'];
    $payment_currency = $_POST['mc_currency'];
    $txn_id = $_POST['txn_id'];
    $receiver_email = $_POST['receiver_email'];
    $payer_email = $_POST['payer_email'];
    if (strcmp ($res, "VERIFIED") == 0) {
            // process payment
    else if (strcmp ($res, "INVALID") == 0) {
            // log for manual investigation
    ?>

  • How to stop apps from sending and receiving data?

    Or does it even matter because I have cellular data turned off...

    If you have cellular data turned off apps can still send and receive data via WiFi. But why do you have apps that send and receive data if you don't want them to send and receive data?

  • HT201269 i dont hane an i phone anymore and now i cant receive texts on my new phone

    Help Me please! i dont have an Iphone anymore. I cant receivce texts on my new phone. I have talked to apple support and they said all they needed to do was deactivate my i message and they did and i still cant receive messages. Can someone help me. This has been ongoing for days and everytime im told it will work it still does not.

    Hi nathanabc,
    If you are having issues deactivating iMessage, you may find the "Unlink a phone number" portion of the following article helpful:
    iOS and OS X: Link your phone number and Apple ID for use with FaceTime and iMessage
    http://support.apple.com/kb/HT5538
    Regards,
    - Brenden

  • Can i have html code for date select options (SEARCH HELP)

    Hi frinds,
    I have a BSP Page with input as date.
    Can i have html code for date select options (SEARCH HELP)
    Moosa

    Hi
    Please find the sample code below.
    FROM DATE
          <htmlb:inputField id        = "dd"
                            width     = "45%"
                            type      = "DATE"
                            showHelp  = "X" <- Search help
                            alignment = "CENTER"
                            maxlength = "10"
                            disabled  = "TRUE"
                            value     = "<%= w_FROMDATE %>" />
    TO DATE
          <htmlb:inputField id        = "dd"
                            width     = "45%"
                            type      = "DATE"
                            showHelp  = "X"
                            alignment = "CENTER"
                            maxlength = "10"
                            disabled  = "TRUE"                      
    value     = "<%= w_TODATE %>" />
    Thanks
    kalyan

Maybe you are looking for

  • 9.1.2 Update Fails in Acrobat Pro 9

    I am running a standalone version of Acrobat Pro 9 on an iMac running Mac OS X 10.5.8. I am trying to update Acrobat Pro 9 from 9.1.1 to 9.1.2 without success. I have had problems with EVERY SINGLE update from 9.0.0 whether from help>check for update

  • How do I know if my Airport Extreme can do WDS?

    Hi, I have a 4th generation Airport Extreme and an Airport Express (don't know the generation). My plan is to create an extended wireless network based on WDS. On my Airport Express I can select 'participate in a WDS network' in 'Wireless Mode', but

  • Transferring Music from Macbook pro to iphone

    So I just bought my new macbook pro and I have already transferred all my music from my iphone onto the computer itself. However, throughout the day I have been dowloading music from the internet using a youtube converter site. They dowloaded onto th

  • Neither Safari nor Firefox can view PDF files on the web - they appear blank?

    Starting a couple of weeks ago, now when i'm at a web site and I click on a link that is a pdf, the screen is blank dark gray.  I closed Safari and opened firefox and tried to see if that would work.  Firefox also didn't display the pdf, just a blank

  • Where can I DL the CS 5.5 Uninstaller for OS X?

    Where can I DL the CS 5.5 Uninstaller for OS X?