Browse Source

removed warnings

master
Sebastian Rieger 7 years ago
parent
commit
1855aea1ae
  1. 1
      VerteilteSysteme-Examples/src/verteiltesysteme/socket/simple/TCPServer.java
  2. 2
      VerteilteSysteme-Examples/src/verteiltesysteme/socket/simple/UDPServer.java

1
VerteilteSysteme-Examples/src/verteiltesysteme/socket/simple/TCPServer.java

@ -12,6 +12,7 @@ class TCPServer {
String capitalizedSentence; String capitalizedSentence;
// Server-Socket erzeugen // Server-Socket erzeugen
@SuppressWarnings("resource")
ServerSocket welcomeSocket = new ServerSocket(tcpPort); ServerSocket welcomeSocket = new ServerSocket(tcpPort);
while (true) { while (true) {

2
VerteilteSysteme-Examples/src/verteiltesysteme/socket/simple/UDPServer.java

@ -2,12 +2,12 @@
package verteiltesysteme.socket.simple; package verteiltesysteme.socket.simple;
import java.io.*;
import java.net.*; import java.net.*;
class UDPServer { class UDPServer {
public static void main(String args[]) throws Exception { public static void main(String args[]) throws Exception {
int udpPort = 36037; int udpPort = 36037;
@SuppressWarnings("resource")
DatagramSocket serverSocket = new DatagramSocket(udpPort); DatagramSocket serverSocket = new DatagramSocket(udpPort);
byte[] receiveData = new byte[1024]; byte[] receiveData = new byte[1024];
byte[] sendData = new byte[1024]; byte[] sendData = new byte[1024];

Loading…
Cancel
Save