nginx怎么设置max

nginx怎么设置max,第1张

可能现在对局域网上网用户限制比较多,比如不能上一些网站,不能玩某些游戏,不能上MSN,端口限制等等,一般就是通过代理服务器上的软件进行限制,如现在谈的最多的ISA Server 2004,或者是通过硬件防火墙进行过滤。下面谈谈如何突破限制,需要分限制情况进行说明:
 一、单纯的限制某些网站,不能访问,网络游戏(比如联众)不能玩,这类限制一般是限制了欲访问的IP地址。
对于这类限制很容易突破,用普通的>

如果你要获取的是Internet时间,可以使用NTP服务。

NTP概念简介 
Network Time Protocol(NTP)是用来使计算机时间同步化的一种协议,它可以使计算机对其服务器或时钟源(如石英钟,GPS等等)做同步化,它可以提供高精准度的时间校正(LAN上与标准间差小于1毫秒,WAN上几十毫秒),且可介由加密确认的方式来防止恶毒的协议攻击。

java实现:

import javaioInputStream;
import javanetSocket;
public class TimeUtil {
    public static final int DEFAULT_PORT = 37;//NTP服务器端口
    public static final String DEFAULT_HOST = "time-nwnistgov";//NTP服务器地址
    private TimeUtil() {
    };
    public static long currentTimeMillis(Boolean sync) {
        if (sync != null && syncbooleanValue() != true)
            return SystemcurrentTimeMillis();
        try {
            return syncCurrentTime();
        } catch (Exception e) {
            return SystemcurrentTimeMillis();
        }
    }
    public static long syncCurrentTime()  throws Exception {
        // The time protocol sets the epoch at 1900,
        // the java Date class at 1970 This number
        // converts between them
        long differenceBetweenEpochs = 2208988800L;
        // If you'd rather not use the magic number uncomment
        // the following section which calculates it directly
        /
          TimeZone gmt = TimeZonegetTimeZone("GMT"); Calendar epoch1900 =
          CalendargetInstance(gmt); epoch1900set(1900, 01, 01, 00, 00, 00);
          long epoch1900ms = epoch1900getTime()getTime(); Calendar epoch1970
          = CalendargetInstance(gmt); epoch1970set(1970, 01, 01, 00, 00, 00);
          long epoch1970ms = epoch1970getTime()getTime();
          
          long differenceInMS = epoch1970ms - epoch1900ms; long
          differenceBetweenEpochs = differenceInMS/1000;
         /
        InputStream raw = null;
        try {
            Socket theSocket = new Socket(DEFAULT_HOST, DEFAULT_PORT);
            raw = theSocketgetInputStream();
            long secondsSince1900 = 0;
            for (int i = 0; i < 4; i++) {
                secondsSince1900 = (secondsSince1900 << 8) | rawread();
            }
            if (raw != null)
                rawclose();
            long secondsSince1970 = secondsSince1900 - differenceBetweenEpochs;
            long msSince1970 = secondsSince1970  1000;
            return msSince1970;
        } catch (Exception e) {
            throw new Exception(e);
        }
    }
}

中国大概能用的NTP时间服务器 
     server 133100118 prefer 
     server 2107214544 
     server 20311718036 //程序中所用的 
     server 131107110 
     server timeasiaapplecom 
     server 642369653 
     server 1301491721 
     server 669268246 
     server >

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/13445696.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-08-08
下一篇 2023-08-08

发表评论

登录后才能评论

评论列表(0条)

保存