diff --git a/src/test/java/io/bitsquare/msg/UDPClient.java b/src/test/java/io/bitsquare/msg/UDPClient.java deleted file mode 100644 index cca423ac18..0000000000 --- a/src/test/java/io/bitsquare/msg/UDPClient.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * This file is part of Bitsquare. - * - * Bitsquare is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * Bitsquare is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - * License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Bitsquare. If not, see . - */ - -package io.bitsquare.msg; - -import java.io.BufferedReader; -import java.io.InputStreamReader; - -import java.net.DatagramPacket; -import java.net.DatagramSocket; -import java.net.InetAddress; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -// http://systembash.com/content/a-simple-java-udp-server-and-udp-client/ -public class UDPClient { - private static final Logger log = LoggerFactory.getLogger(UDPClient.class); - - public static void main(String args[]) throws Exception { - BufferedReader inFromUser = - new BufferedReader(new InputStreamReader(System.in)); - DatagramSocket clientSocket = new DatagramSocket(); - InetAddress IPAddress = InetAddress.getByName("188.226.179.109"); - byte[] sendData = new byte[1024]; - byte[] receiveData = new byte[1024]; - String sentence = inFromUser.readLine(); - sendData = sentence.getBytes(); - DatagramPacket sendPacket = new DatagramPacket(sendData, sendData.length, IPAddress, 9876); - clientSocket.send(sendPacket); - DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length); - clientSocket.receive(receivePacket); - String modifiedSentence = new String(receivePacket.getData()); - System.out.println("FROM SERVER:" + modifiedSentence); - clientSocket.close(); - } -} diff --git a/src/test/java/io/bitsquare/msg/UDPServer.java b/src/test/java/io/bitsquare/msg/UDPServer.java deleted file mode 100644 index 1d95120620..0000000000 --- a/src/test/java/io/bitsquare/msg/UDPServer.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * This file is part of Bitsquare. - * - * Bitsquare is free software: you can redistribute it and/or modify it - * under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or (at - * your option) any later version. - * - * Bitsquare is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public - * License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with Bitsquare. If not, see . - */ - -package io.bitsquare.msg; - -import java.net.DatagramPacket; -import java.net.DatagramSocket; -import java.net.InetAddress; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -// http://systembash.com/content/a-simple-java-udp-server-and-udp-client/ - -public class UDPServer { - private static final Logger log = LoggerFactory.getLogger(UDPServer.class); - - public static void main(String args[]) throws Exception { - DatagramSocket serverSocket = new DatagramSocket(9876); - byte[] receiveData = new byte[1024]; - byte[] sendData = new byte[1024]; - while (true) { - DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length); - serverSocket.receive(receivePacket); - String sentence = new String(receivePacket.getData()); - System.out.println("RECEIVED: " + sentence); - InetAddress IPAddress = receivePacket.getAddress(); - int port = receivePacket.getPort(); - String capitalizedSentence = sentence.toUpperCase(); - sendData = capitalizedSentence.getBytes(); - DatagramPacket sendPacket = - new DatagramPacket(sendData, sendData.length, IPAddress, port); - serverSocket.send(sendPacket); - } - } -}