Guest User

Untitled

a guest
Nov 25th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. die Sender-Klasse:
  2.  
  3. public void send(final int arg, final String toSend) throws IOException {
  4. try {
  5. out.write(arg);
  6.  
  7. Thread.sleep(100);
  8.  
  9. out.write(toSend);
  10.  
  11. Thread.sleep(100);
  12. }
  13. catch(InterruptedException err) {
  14.  
  15. }
  16. }
  17.  
  18. Die Receiver-Klasse:
  19.  
  20. private String receive() {
  21. try {
  22. return in.readLine();
  23. }
  24. catch(SocketException err){
  25. return err.toString() + " (Verbindung zum Server getrennt)";
  26. }
  27. catch(Exception err) {
  28. return err.toString();
  29. }
  30. }
Add Comment
Please, Sign In to add comment