1234567891011121314151617181920212223242526272829303132333435363738394041 |
- /*
- * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
- * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
- */
- package ChatProgramm.model;
-
- import ChatProgramm.view.ChatView;
- import java.io.IOException;
- import java.net.Socket;
- import java.util.logging.*;
-
- /**
- * Builder Class
- *
- * @author le
- */
- public class Client extends Transmitter {
-
- private static Logger lg = Logger.getLogger("netz");
- private static final int PORT = 35000; //lt. iana port > 2¹⁵
- private static final String IP = "127.0.0.1";
-
-
- public Client(ChatView view) throws IOException {
- super(view);
- connect();
- initIO();
- }
-
-
- @Override
- public void connect() throws IOException {
- try {
- lg.info("Client: Verbindung wird aufgebaut");
- socket = new Socket(IP, PORT);
- lg.info("Client: Verbindung aufgebaut");
- } catch (java.io.InterruptedIOException e) {
- lg.warning("Timeout" + "(" + timeout / 1000 + "s)");
- }
- }
- }
|