08-19-2008 08:15 AM - edited 03-13-2019 05:34 PM
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);
}
}
08-20-2008 08:36 AM
Hi, maybe you could find some additional info looking at the phone's log :
http://
Hope this helps,
Alberto
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide