- connector
- XXXconnection
- XXXchannel or upstram-pipeline for accept/receive
- XXXtransport or downstream-pipeline for send
- handler
- io buffer
- codedec
- server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary>log write to console | |
/// </summary> | |
public class DefaultLogger : ILog | |
{ | |
public string Name { get; private set; } | |
public bool IsDebugEnabled { get; private set; } | |
public bool IsInfoEnabled { get; private set; } | |
public bool IsWarnEnabled { get; private set; } | |
public bool IsErrorEnabled { get; private set; } | |
public bool IsFatalEnabled { get; private set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Net; | |
using System.Net.Sockets; | |
using System.Text; | |
using System.Threading; | |
namespace TopPushClientTest | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tcpdump -i eth0 src 10.13.3.3 and port 7001 | |
tcpdump -i eth0 dst 10.13.3.3 and port 7001 | |
tcpdump -i eth0 -A -nn dst 10.13.3.3 and port 7001 | |
tcpdump -i eth0 -w dump.pcap dst 10.13.3.3 and port 7001 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//c# byte 0-255 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
// easy timer task, support delay and reset | |
public class ResetableTimer { | |
private boolean running; | |
private Thread boss; | |
private ExecutorService threadPool; | |
private Runnable task; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class NamedThreadFactory implements ThreadFactory { | |
static final AtomicInteger poolNumber = new AtomicInteger(1); | |
final AtomicInteger threadNumber = new AtomicInteger(1); | |
final ThreadGroup group; | |
final String prefix; | |
final boolean isDaemon; | |
final int priority; | |
public NamedThreadFactory() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//view all certificates | |
certmgr.msc | |
//http://msdn.microsoft.com/en-us/library/bfsktky3(VS.80).aspx | |
//make certificates | |
makecert -sk testcer -n "CN=testcer" -ir localmachine -ss my -sky exchange testcer.cer | |
makecert -r -pe -n "CN=workflowcer" -b 01/01/2005 -e 01/01/2050 -sky exchange -ss my | |
makecert -r -pe -n "CN=testcer" -b 01/01/2005 -e 01/01/2050 -sky exchange -ss my |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// context interface to resolve env dependency | |
public interface ContextService { | |
public Object get(String key); | |
} | |
// context base | |
// alose can impl via aop inspector | |
public class BizServiceAdapter implements BizInterface { | |
private ContextService context; | |
private BizService bizService; |