aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
authorwilliamchitto <williamchitto@gmail.com>2012-07-31 12:00:03 -0300
committerwilliamchitto <williamchitto@gmail.com>2012-07-31 12:00:03 -0300
commitb11ff82a003b828dbaecc564c54d447440249701 (patch)
treeb17fd61037e054c200b31aa0e60cc4e01e5f8aa4 /test/org/traccar
parentf5e305c4ea89210a2e4daffa4e947acdc440fbe7 (diff)
downloadtraccar-server-b11ff82a003b828dbaecc564c54d447440249701.tar.gz
traccar-server-b11ff82a003b828dbaecc564c54d447440249701.tar.bz2
traccar-server-b11ff82a003b828dbaecc564c54d447440249701.zip
Added socket client
Diffstat (limited to 'test/org/traccar')
-rw-r--r--test/org/traccar/server/SocketCliente.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/org/traccar/server/SocketCliente.java b/test/org/traccar/server/SocketCliente.java
new file mode 100644
index 000000000..c26c02e49
--- /dev/null
+++ b/test/org/traccar/server/SocketCliente.java
@@ -0,0 +1,44 @@
+package org.traccar.server;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.net.Socket;
+
+public class SocketCliente {
+
+ /**
+ * @param args
+ */
+ public void SendMSG(String url, int port, String msg) {
+
+ Socket s = null;
+
+ PrintStream ps = null;
+
+ try {
+
+ s = new Socket(url, port);
+
+ ps = new PrintStream(s.getOutputStream());
+
+ ps.println(msg);
+
+ System.out.println("send");
+
+ } catch (IOException e) {
+
+ System.out
+ .println("Some problem happened on send data to socket.");
+
+ } finally {
+
+ try {
+ s.close();
+ } catch (IOException e) {
+ }
+
+ }
+
+ }
+
+}