summaryrefslogtreecommitdiff
path: root/client/Piztor/src/com/macaroon/piztor/PushClient.java
diff options
context:
space:
mode:
Diffstat (limited to 'client/Piztor/src/com/macaroon/piztor/PushClient.java')
-rw-r--r--client/Piztor/src/com/macaroon/piztor/PushClient.java26
1 files changed, 25 insertions, 1 deletions
diff --git a/client/Piztor/src/com/macaroon/piztor/PushClient.java b/client/Piztor/src/com/macaroon/piztor/PushClient.java
index fff39fe..7cecfba 100644
--- a/client/Piztor/src/com/macaroon/piztor/PushClient.java
+++ b/client/Piztor/src/com/macaroon/piztor/PushClient.java
@@ -28,8 +28,10 @@ public class PushClient {
static final int Message = 0;
static final int Location = 1;
+ static final int Marker = 2;
static final int PushMessage =100;
static final int PushLocation =101;
+ static final int PushMarker =102;
static final int Reconnect =-2;
@@ -46,6 +48,7 @@ public class PushClient {
client = new Socket();
client.connect(new InetSocketAddress(site,port), retime);
client.setSoTimeout(2000);
+ //client.setTcpNoDelay(true);
} catch (UnknownHostException e) {
e.printStackTrace();
throw e;
@@ -169,7 +172,28 @@ public class PushClient {
out.write(o);
out.flush();
break;
- }
+ case Marker:
+ int lv = in.readUnsignedByte();
+ double lat = in.readDouble();
+ double lot = in.readDouble();
+ int dtime = in.readInt();
+ if(LastPrint != p) {
+ Message msg = new Message();
+ msg.what = PushMarker;
+ msg.obj = new ResPushMarker(lat,lot,dtime,lv);
+ recall.sendMessage(msg);
+ LastPrint = p;
+ }
+ Convert.write(o,Convert.intToBytes(outlen),pos);
+ pos+=IntLength;
+ o[pos]=(byte) Marker;
+ pos+=ByteLength;
+ Convert.write(o,Convert.hexStringToBytes(p),pos);
+ pos+=FingerPrintLength;
+ out.write(o);
+ out.flush();
+ break;
+ }
} catch (IOException e) {
e.printStackTrace();