mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-07-24 23:46:00 -04:00
Remove test classes
This commit is contained in:
parent
0f65441700
commit
a3abd2fd69
2 changed files with 0 additions and 101 deletions
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue