上午9点~12点
写项目,客户端与服务器的连接,服务器采用多线程,
InetAddress ip4 = null;
try {
ip4 = Inet4Address.getLocalHost();//获取此电脑的ip地址
}catch (UnknownHostException e){
e.printStackTrace();
}
Socket st = new Socket(ip4,9999);
ServerSocket ss = new ServerSocket(9999);
while (true) {
Socket s = ss.accept();
new Thread(new ServerTread(s)).start();
}
下午4点~晚上9点
学习了解雪花算法,制作界面,踩坑,看视频学习,与其他人交流
public class RegisterDemo extends Application {
@Override
public void start(Stage primaryStage) throws Exception {
Parent root = FXMLLoader.load(getClass().getResource("viewlogin.fxml"));
Scene sc = new Scene(root);
primaryStage.setTitle("登录界面");
primaryStage.setScene(sc);
primaryStage.show();
}
public RegisterDemo(){};
}
@Override
public void start(Stage primaryStage) throws Exception {
new RegisterDemo().start(primaryStage);
}
晚上9点~9点30
反思,查资料,构思,优化改进构思,
晚上9点30~10点
每日总结