HanG321 Blog
Be Shine, Be Smile, Be Wild

六月

July 12, 2009|生活記事

六月很快又過了… 呢個月上司返左 UK 2 個weeks, 通常呢, 出事既時候都係相關既人行開左, 係呢段時間非常掛住我呢個上司 🙂 下旬就係production push 既日子, 今次因為唔再係6:00pm 先開始, 所係由 10:00 am – 8:00 pm 順風順水咁搞掂 個 SCBCD 既試, 唉, 有點 shame, 自己其實未讀曬, (懶+考試先黎OT) 只係個 mock 太勁, 91% pass, 個officer 話 well done, 仲問我係咪好努力, 我唯有話 係呀係呀….. 買左 xbox 360, 呢2個weekend 就沈迷左係 Call of duty 4 既世界..

Read more »

AsyncWeb & load test

June 2, 2009|asyncweb, Java, mina|電腦編程

There is insufficient information for AsyncWeb (subproject of Mina) on internet, what I need is simulating a web services that reply in various seconds for load testing. the following code may not be correct, some wiered debug message… and I just depressed it by log4j.properties Mostly follow the lightweight example of AsyncWeb, the eclipse project zip can be obtained here public class Main { private static final int PORT = 80; /** * Main * * @param args * @throws IOException */ public static void main(String[] args) throws IOException { SocketAcceptor acceptor = new NioSocketAcceptor(); acceptor.getFilterChain().addLast(“codec”, new ProtocolCodecFilter(new HttpCodecFactory())); acceptor.getFilterChain().addLast(“executor”, new ExecutorFilter(new OrderedThreadPoolExecutor(32))); //Allow the port to be reused even if the socket is in TIME_WAIT state acceptor.setReuseAddress(true); acceptor.getSessionConfig().setReuseAddress(true); acceptor.getSessionConfig().setReceiveBufferSize(1024); acceptor.getSessionConfig().setSendBufferSize(1024); // No Nagle’s algorithm acceptor.getSessionConfig().setTcpNoDelay(true); acceptor.getSessionConfig().setSoLinger(-1); acceptor.setBacklog(10240); acceptor.setHandler(new CustomHttpIoHandler()); // customer handler acceptor.bind(new InetSocketAddress(PORT)); } } public class CustomHttpIoHandler implements IoHandler { private final Logger logger = LoggerFactory.getLogger(getClass()); private final Timer timer; private Random random = new Random(System.currentTimeMillis()); private final String SOAPENV_HEAD = “”; public CustomHttpIoHandler(){ timer = new Timer(true); } public void exceptionCaught(IoSession session, Throwable cause) throws Exception { if (!(cause instanceof IOException)) { cause.printStackTrace(); } session.close(true); } public void messageSent(IoSession session, Object message) throws Exception { } public void sessionClosed(IoSession session) throws Exception { } public void sessionCreated(IoSession session) throws Exception { } public void sessionIdle(IoSession session, IdleStatus status) throws Exception { session.close(true); } public void sessionOpened(IoSession session) throws Exception { session.getConfig().setIdleTime(IdleStatus.BOTH_IDLE, 30); } public void messageReceived(IoSession session, Object message) throws Exception { HttpRequest req = (HttpRequest) …

Read more »

xbox 360

June 1, 2009|xbox|生活記事

今個月既expenditure 嚴重超支, 下個月又要俾 vehicle registration fee, 雖然 AUD 近日回升得幾勁, 不過我既支出都係 AUD, 物價又唔見得平左…. EB games 出左個 promotion, 當然又俾班同事說我買, 仲專登send 另一個 jb hi-fi deal 俾我 今日走左去 helensvale 問, 冇貨, 哈哈, 都好, 有藉口唔買 ~~~ 之前有個調查話 australia 係最多人買console (inc. xbox/ps3/wii) 既地方, 應該都係, 係屋企打機唔使使咁多錢, 好過出街 🙂 星期五去左另一個同事屋企玩 poker, 第一次去到 palm beach 咁南, burleigh waters 已經夠遠, 要45mins 先返到office, 我就真係唔ok 啦… 不過間屋有泳池 水池, summer 真係幾爽既 前排冇左墨西哥一個大客, 佔收入30-40% 掛, 好在 spot 黎緊會出街, sales team 既人都幾好野, 都未有demo (our system) 都簽都40幾部出去. 老闆仲話要8月前出街….. omg, 呢2個月唔使旨意leave on time 只係hea 左一個week 就冇啦…. 不過上司卻叫我不用埋會, 多數都唔會8月前要起貨, 先做好plan 左既野先 可能係佢已經聽過好多 “urgent” request, 已經知道根本唔urgent :p

Read more »
...10203031323334...60...

搜尋 Search

Copyright © 2004-2021 hang321.net. All Rights Reserved