首页>代码>java swing聊天室代码>/jq/src/client/DataBuffer.java
/**
 * ClassName: DataBuffer.java
 * Author: qiujy
 * CreateTime: 2009-4-15
 * EMAIL: qjyong@gmail.com
 * Copyright 2009 ++YONG All rights reserved.
 */
package client;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.io.*;
import java.net.*;
import java.util.*;
import client.model.entity.OnlineUserListModel;
import common.model.entity.User;

/** 客户端数据缓存 */
public class DataBuffer {
	/** 当前客户端的用户信息 */
	public static User currentUser;
	/** 在线用户列表 */
	public static List<User> onlineUsers;
	/** 当前客户端连接到服务器的套节字 */
	public static Socket clientSeocket;
	/** 当前客户端连接到服务器的输出流 */
	public static ObjectOutputStream oos;
	/** 当前客户端连接到服务器的输入流 */
	public static ObjectInputStream ois;
	/** 服务器配置参数属性集 */
	public static Properties configProp;
	/** 当前客户端的屏幕尺寸 */
	public static Dimension screenSize;
	/** 本客户端的IP地址 */
	public static String ip ;
	/** 用来接收文件的端口 */
	public static final int RECEIVE_FILE_PORT = 6666;
	/** 在线用户JList的Model */
	public static OnlineUserListModel onlineUserListModel;

	static{
		screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		//加载服务器配置文件
		configProp = new Properties();
		try {
			ip = InetAddress.getLocalHost().getHostAddress();
			configProp.load(Thread.currentThread()
									.getContextClassLoader()
									.getResourceAsStream("serverconfig.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
	
	private DataBuffer(){}
}
最近下载更多
等风来2020  LV3 2023年12月10日
buhuia  LV4 2023年6月9日
yangguang  LV8 2022年12月28日
dongandmin  LV6 2022年12月10日
caohanren  LV11 2022年12月9日
daidin  LV11 2022年7月20日
Kevin_001  LV6 2022年7月3日
小冷依诺  LV6 2022年6月23日
微信网友_5992582549164032  LV6 2022年6月21日
渔客不知鱼乐  LV2 2022年6月18日
最近浏览更多
krispeng  LV6 4月16日
taoshen95  LV14 1月19日
陈小灏  LV14 2023年12月27日
pangzhihui  LV12 2023年12月14日
等风来2020  LV3 2023年12月10日
fesfefe  LV13 2023年11月25日
1112WHQ  LV7 2023年11月3日
遇见就珍惜吧 2023年10月27日
暂无贡献等级
Wsy2860  LV1 2023年9月6日
hongdongdong  LV12 2023年8月9日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友