public class SocketClient extends Client
| Modifier and Type | Field and Description |
|---|---|
static int |
FIRST_PORT |
static java.lang.String |
HOST |
static int |
LAST_PORT |
static java.lang.String |
TERMINATOR |
API_VERSION, DEFAULT_TIMEOUT, DEFAULT_TOKEN_TIMEOUT, DFLT_POLL_INTERVAL, isVerbose, LEN_POLLS_INTERVAL, POLLS_INTERVAL, SOFTWARE_VENDOR_ID| Constructor and Description |
|---|
SocketClient(java.lang.String username,
java.lang.String password) |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes opened connections (if any), cleans up resources.
|
boolean |
connect()
Opens API-specific connection if not opened yet.
|
void |
finalize() |
Captcha |
getCaptcha(int id)
Fetches an uploaded CAPTCHA details.
|
User |
getUser()
Fetches user details.
|
boolean |
report(int id)
Reports an incorrectly solved CAPTCHA
|
Captcha |
upload(byte[] img) |
Captcha |
upload(byte[] img,
int type,
byte[] banner,
java.lang.String banner_text) |
Captcha |
upload(byte[] img,
java.lang.String challenge,
int type,
byte[] banner,
java.lang.String banner_text) |
Captcha |
upload(byte[] img,
java.lang.String challenge,
int type,
byte[] banner,
java.lang.String banner_text,
java.lang.String grid)
Uploads a CAPTCHA to the service.
|
Captcha |
upload(int type,
org.json.JSONObject json) |
decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, decode, getBalance, getCaptcha, getPollInterval, getText, getText, load, report, upload, upload, upload, uploadpublic static final java.lang.String HOST
public static final int FIRST_PORT
public static final int LAST_PORT
public static final java.lang.String TERMINATOR
public SocketClient(java.lang.String username,
java.lang.String password)
Client.Client(String, String)public void close()
Clientclose in class ClientClient.close()public boolean connect()
throws java.io.IOException
Clientconnect in class Clientjava.io.IOExceptionClient.connect()public void finalize()
finalize in class java.lang.Objectpublic User getUser() throws java.io.IOException, Exception
ClientgetUser in class Clientjava.io.IOExceptionExceptionClient.getUser()public Captcha upload(byte[] img, java.lang.String challenge, int type, byte[] banner, java.lang.String banner_text, java.lang.String grid) throws java.io.IOException, Exception
Clientupload in class Clientimg - CAPTCHA image byte vectorjava.io.IOExceptionExceptionClient.upload(byte[], java.lang.String, int, byte[], java.lang.String, java.lang.String)public Captcha upload(byte[] img, java.lang.String challenge, int type, byte[] banner, java.lang.String banner_text) throws java.io.IOException, Exception
public Captcha upload(byte[] img, int type, byte[] banner, java.lang.String banner_text) throws java.io.IOException, Exception
public Captcha upload(int type, org.json.JSONObject json) throws java.io.IOException, Exception
public Captcha getCaptcha(int id) throws java.io.IOException, Exception
ClientgetCaptcha in class Clientid - CAPTCHA IDjava.io.IOExceptionExceptionClient.getCaptcha(int)public boolean report(int id)
throws java.io.IOException,
Exception
Clientreport in class Clientid - CAPTCHA IDjava.io.IOExceptionExceptionClient.report(int)