diff options
author | williamchitto <williamchitto@gmail.com> | 2012-07-31 12:00:03 -0300 |
---|---|---|
committer | williamchitto <williamchitto@gmail.com> | 2012-07-31 12:00:03 -0300 |
commit | b11ff82a003b828dbaecc564c54d447440249701 (patch) | |
tree | b17fd61037e054c200b31aa0e60cc4e01e5f8aa4 /test/org/traccar/server | |
parent | f5e305c4ea89210a2e4daffa4e947acdc440fbe7 (diff) | |
download | trackermap-server-b11ff82a003b828dbaecc564c54d447440249701.tar.gz trackermap-server-b11ff82a003b828dbaecc564c54d447440249701.tar.bz2 trackermap-server-b11ff82a003b828dbaecc564c54d447440249701.zip |
Added socket client
Diffstat (limited to 'test/org/traccar/server')
-rw-r--r-- | test/org/traccar/server/SocketCliente.java | 44 |
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) { + } + + } + + } + +} |