URLConnection with https fails every other time

by ole! » Thu, 25 Sep 2008 23:46:10 GMT


Sponsored Links
 Can anyone help?

The code below loops 10 times where each loop does a URL connection
using either http or https.
When using http protocol everything works fine.

When using https, every other message is sent correctly while the
incorrect messages fail silently (no message is sent to the server and
no exception is thrown).
We know no packets are sent because we are using echoport to track
packets.

If the delay between messages is set to 1ms, then all https messages
are sent correctly.


  private void sendHttpsMsg(long id) {
        String urlString = "https://192.168.1.104/msg";
        //String urlString = " http://192.168.1.104/msg" ;;
                        try {
                                URL url = new URL(urlString);
                                Log.i("httpsURL",url.toString());
                                URLConnection connection = url.openConnection();

                                InputStream is = connection.getInputStream();
                                Scanner in  = new Scanner(is);

                                while (in.hasNextLine())
                                        Log.i("httpsURL",in.nextLine());
                        } catch (Exception ioe) {
                                Log.i("httpsURL",ioe.toString());
                        }
    }

    private class HttpMsgThread extends Thread {
        HttpMsgThread() {
                super("httpsMsg");
        }
        public void run() {
                for(int i=0; i<10; i++) {
                        sendHttpsMsg(getId());
                        try {Thread.sleep(10000);}
                        catch (InterruptedException e) {}
                }
        }
    }


--~--~---------~--~----~------------~-------~--~----~



Other Threads

1. porting android to a custom board casusing SIGSEGV

Hi,

I am porting android to a custom OMAP 3430 board which has
linux-2.6.28-rc9-omap1 kernel.

embinux, it causes sigsegv.

#strace /usr/sbin/chroot platform/android/omap3droid /init
execve("/usr/sbin/chroot", ["/usr/sbin/chroot",
"platform/android/omap3droid", "/init"], [/* 17 vars */]) = 0
uname({sys="Linux", node="OMAP3EVM", ...}) = 0
brk(0)                                  = 0x1f2000
brk(0x1f2d02)                           = 0x1f2d02
set_tls(0x1f24a0, 0x1c5ab0, 0, 0x1c6700, 0x1f24a0) = 0
brk(0x213d02)                           = 0x213d02
brk(0x214000)                           = 0x214000
getpid()                                = 452
getuid32()                              = 0
chroot("platform/android/omap3droid")   = 0
chdir("/")                              = 0
execve("/init", ["/init"], [/* 17 vars */]) = 0
gettid()                                = 452
set_tls(0xbe8b0b74, 0xbe8b0c74, 0, 0x40, 0xbe8b0c74) = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++


Any pointers , how to fix this.

Thanks and Regards,
HarishKumar.V

--~--~---------~--~----~------------~-------~--~----~
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: 

2. How to display an animated GIF file

Hi,

I just want to display an animated GIF file. I tried and its static
only, its not animating. There are other ways like frame by frame or
using animation classes.

But I want to know, whether android supports animated GIF image.

Thanks
Nithin
--~--~---------~--~----~------------~-------~--~----~

3. handling location error conditions

4. I want to know to get browse history on android ?

5. Audio input- capturing external audio

6. multiple selection in drop down list -spinner like widget

7. Efficiency of requestLocationUpdates() and how to save these gps data