cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
475
Views
0
Helpful
1
Replies

7971GE rejects repeat /CGI/Screenshot when lightly loaded...

Ted_hulick
Level 1
Level 1

I realize this may be more appropriate for another forum (I'll post there as well) - but my 7971GE phone starts rejecting connections after a series of screen snapshots /CGI/Screenshot EVEN 30 seconds apart...

I've attached a test program that you can run...it just loops and executes a screenshot every x milliseconds...

java testphone 30000 yourIP

The 7940 does not seem to have this problem

Test Program Source (I keep getting content type of xxx.java not allowed):

import java.io.*;

import java.awt.*;

import java.awt.image.*;

import java.net.*;

import javax.imageio.*;

public class testphone

{

public static void main(String[] args)

{

int count=0;

if(args.length==0) {

System.out.println("Usage is: java testphone iter gap ip");

System.out.println("Example: java testphone 50 10000 192.168.7.120");

System.exit(0);

}

for(int i=0;i<Integer.parseInt(args[0]);i++) {

try {

count++;

String myFile="test"+count+".gif";

System.out.println("Creating Snapshot "+myFile);

new testphone().doit(args[2],myFile,"any","any");

System.out.println("Done Creating Snapshot "+myFile);

}

catch(Exception e) {

System.out.println("Crashed: "+e.toString());

}

try { Thread.sleep(Integer.parseInt(args[1])); } catch(Exception e) { }

}

}

public void doit(String theIP,String fName,String User,String Pass) throws Exception

{

URL url = new URL("http://"+theIP+"/CGI/Screenshot");

HttpURLConnection conn = (HttpURLConnection)url.openConnection();

conn.setReadTimeout(5000);

conn.setConnectTimeout(5000);

conn.setDoInput(true);

conn.setDoOutput(true);

conn.setRequestMethod("GET");

conn.setRequestProperty("Content-type","application/x-www-form-urlencoded");

String theAuth=User+":"+Pass;

theAuth=new sun.misc.BASE64Encoder().encode(theAuth.getBytes());

conn.setRequestProperty("Authorization","Basic "+theAuth);

BufferedImage image=ImageIO.read((InputStream)conn.getInputStream());

File NewFile = new File(fName);

ImageIO.write(image, "gif", NewFile);

}

}

1 Reply 1

agiaccone
Level 1
Level 1

Hi, maybe you could find some additional info looking at the phone's log :

http:///CGI/Java/Serviceability?adapter=device.statistics.consolelog

Hope this helps,

Alberto

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: