Method from net.bonzoun.cocodonkey.DonkeyTalker Detail: |
public synchronized void addAServer(String host,
String port) {
if (port==null)
port = "";
sendNoFail("n " + host + " " + port);
}
|
public synchronized void addListener(Listener listener) {
listeners.add(listener);
}
|
public synchronized void addServerMet(String file) {
sendNoFail("servers " + file);
}
|
public synchronized void addServers() {
sendNoFail("c");
}
|
public synchronized List allServersList() {
ArrayList liste = new ArrayList();
CamlData servers = fileServers.data().get("known_servers");
int nb = servers.size();
for(int i=0; i< nb; i++) {
CamlData server = servers.get(i);
int id = i+1;
String ip = server.get("server_addr").getString(0) + ':' + server.get("server_addr").getString(1);
String name = server.getString("server_name") + " - " + server.getString("server_desc");
if (ip.length() >0)
liste.add(new ServerItem(id, ip, name, 0, 0));
}
return liste;
/*int state = 0;
try {
send("vma");
if (socket==null)
return new ArrayList();
while(state< 2 && !shouldStopCommand) {
String line = readLine();
if (line==null || line.length()==0)
break;
switch (state) {
case 0:
case 1: {
StringParser parser = new StringParser(line);
parser.goAfter('[');
int id = parser.getNextIntUntil("]", -1);
parser.goAfter(']');
String ip = parser.getNextString();
String name = parser.getRemainingString();
if (ip.length() >0) {
liste.add(new ServerItem(id, ip, name, 0, 0));
state = 1;
}
else if (state==1) {
state = 2;
}
break;
}
}
}
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
return liste;*/
}
|
public synchronized void cancel(DownloadItem item) {
sendNoFail("cancel " + item.id());
// sendNoFail("close_fds");
}
|
public synchronized void close() throws IOException {
if (out!=null) {
out.close();
out = null;
}
if (in!=null) {
in.close();
in = null;
}
if (socket!=null) {
logCommandln("< < Close connection > >");
Socket s = socket;
socket = null;
s.close();
}
}
|
public synchronized void closeFds() {
sendNoFail("close_fds");
}
|
public synchronized void commit() {
try {
send("commit");
if (socket==null)
return;
while(in.ready() && !shouldStopCommand) {
String line = readLine();
if (line==null)
break;
REMatch result = reCOMMIT.getMatch(line);
if (result!=null)
return;
}
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
}
|
public void connect() throws IOException {
connect(30000);
}
|
synchronized void connect(int timeout) throws IOException {
if (isDead)
return;
if (socket!=null)
close();
defaultTimeout = timeout;
InetAddress addr = InetAddress.getByName(hostname!=null ? hostname : "127.0.0.1");
socket = new Socket(addr, port);
socket.setSoTimeout(timeout);
socket.setSoLinger(true, 20);
in = new BufferedReader(new InputStreamReader(socket.getInputStream(), "ISO8859_1"));
out = new PrintWriter(new OutputStreamWriter(socket.getOutputStream(), "ISO8859_1"));
logCommandln("< < Open connection > >");
testConnection();
}
|
public synchronized void connectToServer(String id) {
sendNoFail("c " + id);
}
|
public int currentDialogOffset() {
return dialogOffset;
}
|
public String dialogSince(int n) {
if (n >=dialogOffset+dialog.length())
return "";
else if (n< =dialogOffset)
return dialog.toString();
else
return dialog.substring(n-dialogOffset);
}
|
public synchronized void disableUploadFor(int n) {
sendAndSearchResult("nu " + n, reVULine2, "$1");
}
|
public synchronized void download(GenericItem item) {
sendNoFail("d " + item.size() + " " + item.hash());
// Addition for mldonkey version > 1.16
sendNoFail("dd " + item.size() + " " + item.hash());
}
|
public synchronized void download(String link) {
sendNoFail("dllink " + link);
}
|
public synchronized NSArray downloadItems() {
NSMutableArray liste = new NSMutableArray();
int state = 0;
try {
send("vd");
if (socket==null)
return new NSArray();
while(state< 3 && !shouldStopCommand) {
String line = readLine();
if (line==null)
break;
switch (state) {
case 0: {
REMatch result = reVDDown0.getMatch(line);
if (result==null)
result = reVDDown0b.getMatch(line);
if (result!=null) {
state = 1;
}
else {
result = reVDDown1.getMatch(line);
if (result!=null) {
int n = strongParseInt(result.substituteInto("$1"), -1);
if (n< =0)
state = 3;
else
state = 2;
}
}
break;
}
case 1: {
StringParser parser = new StringParser(line);
if (parser.goAfter('[')) {
parser.getNextStringUntil(StringParser.INTEGER);
int n = parser.getNextIntUntil("]", -1);
parser.goAfter(']');
String r = parser.getLastString();
float rate;
if (r.equalsIgnoreCase("paused"))
rate = -2;
else
rate = strongParseFloat(r, -1);
int total = parser.getLastInt(-1);
int downloaded;
float percent;
if (total< 0) {
total = parser.getLastInt(-1);
downloaded = parser.getLastInt(-1);
percent = parser.getLastFloat(-1);
} else {
downloaded = parser.getLastInt(-1);
percent = -1;
}
String name = parser.getRemainingString();
if (n >=0)
liste.addObject(new DownloadItem(n, name, percent, downloaded, total, rate));
}
/*REMatch result = reVDLine.getMatch(line);
if (result==null)
result = reVDLineb.getMatch(line);
if (result!=null) {
int n = strongParseInt(result.substituteInto("$1"), -1);
String name = result.substituteInto("$2");
float percent = strongParseFloat(result.substituteInto("$3"), -1);
int downloaded = strongParseInt(result.substituteInto("$4"), -1);
int total = strongParseInt(result.substituteInto("$5"), -1);
String r = result.substituteInto("$6");
float rate;
if (r.equalsIgnoreCase("paused"))
rate = -2;
else
rate = strongParseFloat(r, -1);
liste.addObject(new DownloadItem(n, name, percent, downloaded, total, rate));
}*/
else {
REMatch result = reVDDown1.getMatch(line);
if (result!=null) {
int n = strongParseInt(result.substituteInto("$1"), -1);
if (n< =0)
state = 3;
else
state = 2;
}
}
break;
}
case 2: {
StringParser parser = new StringParser(line);
if (parser.goAfter('[')) {
parser.getNextStringUntil(StringParser.INTEGER + ']');
int n = parser.getNextIntUntil("]", -1);
parser.goAfter(']');
String hash = parser.getLastString();
int size = parser.getLastInt(-1);
String name = parser.getRemainingString();
if (n >=0)
liste.addObject(new DownloadItem(n, name, size, hash));
}
/*REMatch result = reVDDown.getMatch(line);
if (result!=null) {
int n = strongParseInt(result.substituteInto("$1"), -1);
String name = result.substituteInto("$2");
int size = strongParseInt(result.substituteInto("$3"), -1);
String hash = result.substituteInto("$4");
liste.addObject(new DownloadItem(n, name, size, hash));
}*/
else {
REMatch result = reVDEnd.getMatch(line);
if (result!=null) {
state = 3;
}
}
break;
}
}
}
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
return liste;
}
|
public synchronized void extendSearch() {
sendNoFail("xs");
}
|
public synchronized void fillItemDetails(DownloadItem item) {
/*int nbLines = 0;
int nbConn = 0;
CamlData files = fileFiles.data().get("files");
String shortName = (item.name().length() >30 ? item.name().substring(0, 30) : item.name());
for(int i=0; i< files.size(); i++) {
CamlData file = files.get(i);
if (file.getInt("file_size")==item.size()
&& file.get("file_filenames").getString(0).startsWith(shortName)) {
String name = file.get("file_filenames").getString(0);
int total = file.getInt("file_size");
int downloaded = file.getInt("file_downloaded");
String hash = file.getString("file_md4");
item.completeData(name, total, hash, downloaded);
CamlData clients = file.get("file_locations");
nbLines = clients.size();
for(int j=0; j< nbLines; j++) {
if (clients.get(j).getBoolean("client_checked"))
nbConn++;
}
item.setNbClients(nbLines);
item.setNbConn(nbConn);
String chunks = file.getString("file_all_chunks");
item.setChunks(chunks.replace('0', '_').replace('1', 'V'));
return;
}
}*/
long t0 = System.currentTimeMillis();
int state = 0;
try {
send("vd " + item.id());
if (socket==null)
return;
String name = "", hash = "";
int n = 0, total = 0, downloaded = 0;
int nbConn = 0, nbClients = 0, nbClientsSeen = 0;
while(state< 5 && !shouldStopCommand) {
String line = readLine();
if (line==null)
break;
switch (state) {
case 0: {
REMatch result = reVDNLine1.getMatch(line);
if (result!=null) {
n = strongParseInt(result.substituteInto("$1"), -1);
hash = result.substituteInto("$2");
if (hash.length()!=32 || !StringParser.stringContainsOnly(hash, StringParser.HEXA)) {
name = hash;
hash = "";
}
total = strongParseInt(result.substituteInto("$3"), -1);
downloaded = strongParseInt(result.substituteInto("$4"), -1);
state = 1;
}
break;
}
case 1: {
REMatch result = reVDNChunks.getMatch(line);
if (result!=null) {
item.setChunks(result.substituteInto("$1"));
state = 2;
}
break;
}
case 2: {
StringParser parser = new StringParser(line);
if (parser.goAfter('(')) {
String s = parser.getRemainingString();
if (s.length() >0 && s.charAt(s.length()-1)==')')
s = s.substring(0, s.length()-1);
if (hash.length()==0 && s.length()==32 && StringParser.stringContainsOnly(s, StringParser.HEXA)) {
hash = s;
} else {
// We look for the name of the file
if (!StringParser.stringContainsOnly(s, StringParser.HEXA))
name = s;
}
if (hash.length() >0 && name.length() >0) {
if (n==item.id()) {
item.completeData(name, total, hash, downloaded);
} else {
System.out.println("## Bad id: got " + n + " for " + name + " instead of " + item.id());
}
state = 3;
}
break;
}
// No break, we want to go through case 3 by default
}
case 3: {
REMatch result = reVDNSources.getMatch(line);
if (result!=null) {
nbClients = strongParseInt(result.substituteInto("$1"), 0);
item.setNbClients(nbClients);
state = 4;
}
break;
}
case 4: {
if (line.indexOf("onlist true") >=0)
nbConn++;
if (++nbClientsSeen >= nbClients)
state = 5;
break;
}
}
}
if (nbConn >0)
item.setNbConn(nbConn);
else
item.setNbConn(nbClients);
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
}
|
public synchronized void finalClose() {
isDead = true;
try {
close();
}
catch (IOException e) {
}
finally {
if (tunnel!=null) {
tunnel.close();
tunnel = null;
}
}
}
|
public synchronized boolean finalKill() {
isDead = true;
for(int i=0; i< listeners.size(); i++)
((Listener)listeners.elementAt(i)).stopListening();
boolean cr = kill();
finalClose();
return cr;
}
|
protected synchronized void finishRead() throws IOException {
if (socket==null)
connect();
if (socket==null)
return;
socket.setSoTimeout(5000);
try {
while (in.ready())
readLine();
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
finally {
socket.setSoTimeout(defaultTimeout);
}
}
|
public synchronized void forget(int nb) {
sendNoFail("forget " + nb);
}
|
public String hostname() {
return hostname;
}
|
public synchronized boolean kill() {
if (socket==null)
return true;
// sendNoWait("kill");
try {
socket.setSoTimeout(10000);
sendNoWait("kill");
String line = readLine();
if (line!=null && reError.getMatch(line)!=null)
return false;
else
return true;
}
catch(IOException e) {
return true;
}
finally {
try {
socket.setSoTimeout(defaultTimeout);
} catch(IOException e) {}
}
}
|
public synchronized NSDictionary options() {
NSMutableDictionary options = new NSMutableDictionary();
try {
send("vo");
if (socket==null)
return new NSDictionary();
while(!shouldStopCommand) {
String line = readLine();
if (line==null)
break;
REMatch result = reVOData.getMatch(line);
if (result!=null) {
String key = result.substituteInto("$1");
if (key.length() >0) {
String value = result.substituteInto("$2");
options.setObjectForKey(value, key);
if (key.equals("client_md4"))
break;
}
}
}
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
return options;
}
|
public synchronized void pause(DownloadItem item) {
sendNoFail("pause " + item.id());
}
|
public boolean processIsLocal() {
return (hostname==null || hostname.equals("127.0.0.1") || hostname.equals("localhost"))
&& tunnel==null;
}
|
public synchronized NSArray queryList() {
NSMutableArray liste = new NSMutableArray();
int state = 0;
try {
send("vs");
if (socket==null)
return new NSArray();
while(state< 2 && !shouldStopCommand) {
String line = readLine();
if (line==null)
break;
switch(state) {
case 0: {
REMatch result = reVSTitle.getMatch(line);
if (result!=null) {
int nb = strongParseInt(result.substituteInto("$1"), -1);
if (nb==0)
state = 2;
else
state = 1;
}
break;
}
case 1: {
SearchParser parser = new SearchParser(line);
if (parser.searchNumber() >=0) {
liste.addObject(parser);
}
/*REMatch result = reVSLine.getMatch(line);
if (result!=null) {
int id = strongParseInt(result.substituteInto("$1"), -1);
String data = result.substituteInto("$2");
int toGo = strongParseInt(result.substituteInto("$3"), -1);
StringBuffer query = new StringBuffer();
REMatch[] results = reVSData.getAllMatches(data);
for(int i=0; i< results.length; i++) {
if (i >0)
query.append(" ");
query.append(results[i].substituteInto("$1"));
}
liste.addObject(new QueryItem(id, query.toString(), toGo));
}*/
else {
state = 2;
}
break;
}
}
}
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
return liste;
}
|
public synchronized Object[] queryResult(int resNb) {
ArrayList liste = new ArrayList();
int state = 0;
int toGo = 0;
SearchedItem currentItem = null;
try {
send("vr " + resNb);
if (socket==null)
return new Object[0];
while(state< 2 && !shouldStopCommand) {
String line = readLine();
if (line==null || line.length()==0)
break;
switch (state) {
case 0: {
REMatch result = reVRRunning.getMatch(line);
if (result!=null) {
toGo = strongParseInt(result.substituteInto("$2"), -1);
state = 1;
}
else {
result = reVRDone.getMatch(line);
if (result!=null) {
toGo = 0;
int nb = strongParseInt(result.substituteInto("$1"), 0);
if (nb >0)
state = 1;
else
state = 2;
}
}
break;
}
case 1: {
REMatch result = reVRTitle.getMatch(line);
if (result!=null) {
int n = strongParseInt(result.substituteInto("$1"), -1);
String name = result.substituteInto("$3");
currentItem = new SearchedItem(n, name);
liste.add(currentItem);
}
else {
StringParser parser = new StringParser(line);
// We are looking for "size hash ..."
int size = parser.getNextInt(-1);
String hash = parser.getNextString();
if (size >=0 && StringParser.stringContainsOnly(hash, StringParser.HEXA)) {
// Last element can be "nb" or "type"
String type = parser.getLastString();
int nb = 0;
if (StringParser.stringContainsOnly(type, StringParser.INTEGER)) {
nb = StringParser.parseInt(type, 0);
type = parser.getLastString();
}
// Then comes the extension (avi, mp3, ...)
String ext = parser.getLastString();
String length = parser.getNextString();
// Did we read the quality instead of the length ?
if (length.length() >0 && StringParser.stringContainsOnly(length, StringParser.INTEGER)) {
// Maybe that we did not read the quality but nb ?
int i = StringParser.parseInt(length, -1);
length = parser.getNextString();
if ( ! (i!=0 && ((i%64)==0 || ((i%32)==0 && i >=64))) ) {
// We read nb
nb = i;
// We skip "quality"
if (StringParser.stringContainsOnly(length, StringParser.INTEGER))
length = parser.getNextString();
}
}
if (length.length() >0 && length.charAt(length.length()-1)==':') {
length += parser.getNextString();
}
String codec = parser.getRemainingString();
currentItem.addBasicInfo(size, hash, nb);
currentItem.addExtendedInfo(type, ext, codec, length);
}
/*result = reVRData.getMatch(line);
if (result!=null) {
int size = strongParseInt(result.substituteInto("$1"), -1);
String hash = result.substituteInto("$2");
int nb = strongParseInt(result.substituteInto("$4"), -1);
currentItem.addBasicInfo(size, hash, nb);
result = reVRSubData.getMatch(result.substituteInto("$3"));
if (result!=null) {
String type = result.substituteInto("$1");
String ext = result.substituteInto("$2");
String codec = result.substituteInto("$4");
String length = result.substituteInto("$5");
currentItem.addExtendedInfo(type, ext, codec, length);
}
}*/
else {
result = reVREnd.getMatch(line);
if (result!=null) {
state = 2;
}
else if (line.length() >0) {
currentItem.addAlias(line);
}
else {
state = 2;
}
}
}
break;
}
}
}
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
return new Object[]{new Integer(toGo), liste};
}
|
public synchronized void quit() {
if (socket==null)
return;
try {
socket.setSoTimeout(2000);
sendNoWait("q");
sendNoWait("");
finalClose();
}
catch(IOException e) {
e.printStackTrace();
}
}
|
public synchronized void reconnect() {
Thread.dumpStack();
try {
close();
}
catch(IOException e) {
}
try {
connect();
}
catch(IOException e) {
}
}
|
public synchronized void recoverTrash() {
sendNoFail("recover_temp");
}
|
public synchronized void removeListener(Listener listener) {
listeners.remove(listener);
}
|
public synchronized void removeOldServers() {
sendNoFail("remove_old_servers");
}
|
public synchronized void reshare() {
sendNoFail("reshare");
}
|
public synchronized void resume(DownloadItem item) {
sendNoFail("resume " + item.id());
}
|
protected synchronized void send(String command) throws IOException {
sendNoWait(command);
if (socket==null)
return;
// We wait until we get an answer or 10s have elapsed
for(int i=0; i< 100 && !in.ready(); i++) {
try {
Thread.sleep(100);
}
catch(InterruptedException e) {
}
}
}
|
protected synchronized String sendAndSearchResult(String command,
RE match,
String substitute) {
String res = null;
try {
send(command);
if (socket==null)
return null;
while(in.ready() && !shouldStopCommand) {
String line = readLine();
if (line==null)
break;
REMatch result = match.getMatch(line);
if (result!=null)
res = result.substituteInto(substitute);
}
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
return res;
}
|
protected synchronized void sendNoFail(String command) {
try {
send(command);
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
}
|
protected synchronized void sendNoWait(String command) throws IOException {
lastCommand = command; // Very soon because of the stopCommandIfCurrent() method
// We guaranty that we don't send requests faster than one evry 50ms, just to quiet the core
long t = System.currentTimeMillis();
if (t-lastCallTime< 50) {
try {
Thread.sleep(t-lastCallTime);
} catch(InterruptedException e) {}
}
lastCallTime = t;
// We send the command
finishRead();
if (socket==null)
return;
shouldStopCommand = false; // distant from "lastCommand=command" to avoid multithreading problems
out.println(command);
logCommandln(command);
out.flush();
}
|
public synchronized NSArray serversList() {
NSMutableArray liste = new NSMutableArray();
int state = 0;
try {
send("vm");
if (socket==null)
return new NSArray();
while(state< 2 && !shouldStopCommand) {
String line = readLine();
if (line==null || line.length()==0)
break;
switch (state) {
case 0:
case 1: {
StringParser parser = new StringParser(line);
if (parser.goAfter('[')) {
parser.getNextStringUntil(StringParser.INTEGER);
int id = parser.getNextIntUntil("]", -1);
parser.goAfter(']');
String ip = parser.getNextString();
parser.getLastStringUntil(StringParser.INTEGER);
int n2 = parser.getLastInt(-1);
int n1 = parser.getLastInt(-1);
String name = parser.getRemainingString();
liste.addObject(new ServerItem(id, ip, name, n1, n2));
state = 1;
}
/*REMatch result = reVMLine.getMatch(line);
if (result!=null) {
int id = strongParseInt(result.substituteInto("$1"), -1);
String ip = result.substituteInto("$2");
String name;
if (result.getStartIndex(3) >0)
name = result.substituteInto("$3");
else
name = "";
int n1 = strongParseInt(result.substituteInto("$4"), -1);
int n2 = strongParseInt(result.substituteInto("$5"), -1);
liste.addObject(new ServerItem(id, ip, name, n1, n2));
state = 1;
}*/
else if (state==1) {
state = 2;
}
break;
}
}
}
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
return liste;
}
|
public synchronized void setOption(String option,
String value) {
sendNoFail("set " + option + " " + value);
}
|
public synchronized int[] startQuery(String pattern) {
return startQuery(pattern, 0, 0, null, null, null, null, null, 0);
}
|
public synchronized int[] startQuery(String pattern,
int minSize,
int maxSize,
String media,
String format,
String artist,
String album,
String title,
int minBitRate) {
try {
String cmd = "s " + pattern;
// We get the extended options
if (minSize >0)
cmd += " -minsize " + minSize;
if (maxSize >0)
cmd += " -maxsize " + maxSize;
if (media!=null && media.length() >0)
cmd += commandFor(" -media ", media);
if (format!=null && format.length() >0)
cmd += commandFor(" -format ", format);
if (artist!=null && artist.length() >0)
cmd += commandFor(" -artist ", artist);
if (album!=null && album.length() >0)
cmd += commandFor(" -album ", album);
if (title!=null && title.length() >0)
cmd += commandFor(" -title ", title);
if (minBitRate >0)
cmd += " -minbitrate " + minBitRate;
// Run !
send(cmd);
if (socket==null)
return new int[0];
while(in.ready() && !shouldStopCommand) {
String line = readLine();
if (line==null)
break;
REMatch result = reS.getMatch(line);
if (result!=null) {
int[] res = new int[2];
res[0] = strongParseInt(result.substituteInto("$1"), -1);
res[1] = strongParseInt(result.substituteInto("$2"), 0);
return res;
}
}
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
return null;
}
|
public void stopCommandIfCurrent(String cmd) {
if (lastCommand!=null && lastCommand==cmd) {
shouldStopCommand = true;
}
}
|
protected float strongParseFloat(String value,
float def) {
try {
return Float.parseFloat(value);
}
catch(NumberFormatException e) {
return def;
}
}
|
protected int strongParseInt(String value,
int def) {
try {
return Integer.parseInt(value);
}
catch(NumberFormatException e) {
return def;
}
}
|
public synchronized void testConnection() throws IOException {
send("");
if (socket==null)
return;
while (in.ready() && !shouldStopCommand)
readLine();
}
|
public synchronized int uploadCredit() {
String result = sendAndSearchResult("vu", reVULine1, "$1");
if (result!=null)
return Integer.parseInt(result);
else
return -1;
}
|
public synchronized int uploadDisabledTime() {
String result = sendAndSearchResult("vu", reVULine2, "$1");
if (result!=null)
return Integer.parseInt(result);
else
return -1;
}
|
public synchronized void uploadStats(UploadSpeed generalSpeed) {
int state = 0;
try {
send("upstats");
if (socket==null)
return;
while(state< 2 && !shouldStopCommand) {
String line = readLine();
if (line==null)
break;
switch (state) {
case 0: {
REMatch result = reUPTitle2.getMatch(line);
if (result!=null) {
int n = strongParseInt(result.substituteInto("$1"), -1);
generalSpeed.setBytesCount(n);
state = 1;
} else {
result = reUPTitle.getMatch(line);
if (result!=null) {
int n = strongParseInt(result.substituteInto("$1"), -1);
generalSpeed.setBlocCount(n);
state = 1;
}
}
break;
}
case 1: {
/*REMatch result = reUPLine.getMatch(line);
if (result!=null) {
String name = result.substituteInto("$1");
int nbClients = strongParseInt(result.substituteInto("$2"), -1);
int nbBlocs = strongParseInt(result.substituteInto("$3"), -1);
DownloadItem item = dataSource.item(name);
if (item!=null)
item.setBlocsCount(nbBlocs);
} else {*/
REMatch result = reUPDone.getMatch(line);
if (result!=null) {
state = 2;
}
/*}*/
break;
}
}
}
}
catch(IOException e) {
e.printStackTrace();
reconnect();
}
}
|