From 5ef350ac7e7368e1127a89f911779f9ed771899a Mon Sep 17 00:00:00 2001 From: wntr Date: Fri, 8 Jan 2016 14:00:58 +0800 Subject: [PATCH] 2016.1.8 --- .classpath | 1 + .gitignore | 2 ++ lib/slf4j-nop-1.6.1.jar | Bin 0 -> 4812 bytes src/net/fs/cap/CapEnv.java | 7 +++++-- src/net/fs/server/FSServer.java | 20 ++++++++++++++++++-- 5 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 lib/slf4j-nop-1.6.1.jar diff --git a/.classpath b/.classpath index 7e936d5..2df5523 100644 --- a/.classpath +++ b/.classpath @@ -8,5 +8,6 @@ + diff --git a/.gitignore b/.gitignore index ae3c172..1074ba5 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ /bin/ +/client_config.json +/port_map.json diff --git a/lib/slf4j-nop-1.6.1.jar b/lib/slf4j-nop-1.6.1.jar new file mode 100644 index 0000000000000000000000000000000000000000..b7bd5aa0f778ea1a662bfe32af5bfe0906f5fea3 GIT binary patch literal 4812 zcma)AcRbYpA2-g{8Icv?%(L$@j+1hnJ?}`$>V&g*X0py6sf?`3C?oe(sI1H)`-qH0 zW<``_Req7CHmLaL+Cl6uHUqYl?5X~x>qPgT~* z-$Wa>@R>05;;L@L0ntw9QUsknoQHh**SCZKs>iPeeC+JT3>}p8pc^cgWslRw9bH!9 z;Yjz3qDU8mv$?lP)G_k-%QSEcIQ!ARKEC2d<=sS=%)>D&GDeeRleDU2Gi7U)vG%3= zWH0`B2DLTb8WTQ}4KXckf?Z1;(IlQoUx zXccgcwr`Ln)Q=i=V5*GBrbK%rjUP$4Ov$;rnYk+k8x*_FB_RR+aRvaQbKN}cf4YCa#m?F7Sa>qs#sUsbDokI zXB#iC1oWtJzafhS)ktB4^$kxprV5b?LKvAPtw`D-@C}OCc(}}s2xcJxUCzVn{8kS| zq#=1p-Rnk)TlwV`ksO@}-|lgz#STT`xwYIS6_S>JM9u>8$Q}b~nT^7S_#NLD0-48S z9gt@l9#E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-o1=qs6#<~O+i9(fcUvh Ld}#svb^!kahly1n literal 0 HcmV?d00001 diff --git a/src/net/fs/cap/CapEnv.java b/src/net/fs/cap/CapEnv.java index 882ac93..98da8c3 100644 --- a/src/net/fs/cap/CapEnv.java +++ b/src/net/fs/cap/CapEnv.java @@ -195,7 +195,7 @@ PromiscuousMode getMode(PcapNetworkInterface pi){ void initInterface() throws Exception{ detectInterface(); List allDevs = Pcaps.findAllDevs(); - MLog.println("网络接口列表10: "); + MLog.println("Network Interface List: "); for(PcapNetworkInterface pi:allDevs){ String desString=""; if(pi.getDescription()!=null){ @@ -213,9 +213,10 @@ void initInterface() throws Exception{ if(nif.getDescription()!=null){ desString=nif.getDescription(); } - MLog.info("自动选择网络接口:\n"+" "+desString+" "+nif.getName()); + MLog.info("Selected Network Interface:\n"+" "+desString+" "+nif.getName()); }else { tcpEnable=false; + MLog.info("Select Network Interface failed,can't use TCP protocal!\n"); } if(tcpEnable){ sendHandle = nif.openLive(SNAPLEN,getMode(nif), READ_TIMEOUT); @@ -251,6 +252,8 @@ public void run(){ }; thread.start(); } + + MLog.info("FinalSpeed server start success."); } diff --git a/src/net/fs/server/FSServer.java b/src/net/fs/server/FSServer.java index 4c14f9c..1649883 100644 --- a/src/net/fs/server/FSServer.java +++ b/src/net/fs/server/FSServer.java @@ -11,6 +11,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; +import java.net.BindException; import net.fs.rudp.ConnectionProcessor; import net.fs.rudp.Route; @@ -30,8 +31,17 @@ public class FSServer { boolean success_firewall_windows=true; - public static void main(String[] args) throws Exception { - FSServer fs = new FSServer(); + public static void main(String[] args) { + try { + FSServer fs = new FSServer(); + } catch (Exception e) { + e.printStackTrace(); + if(e instanceof BindException){ + MLog.println("Udp port already in use."); + } + MLog.println("Start failed."); + System.exit(0); + } } static FSServer get() { @@ -39,6 +49,8 @@ static FSServer get() { } public FSServer() throws Exception { + MLog.info(""); + MLog.info("FinalSpeed server starting... "); MLog.info("System Name: " + systemName); udpServer = this; final MapTunnelProcessor mp = new MapTunnelProcessor(); @@ -395,4 +407,8 @@ String readFileData(String path) { return content; } + public int getRoutePort() { + return routePort; + } + }