コード例 #1
0
 public SocketRemotingClient(IPEndPoint serverEndPoint, RemotingClientSetting setting = null, ISocketClientEventListener eventListener = null)
 {
     _sync = new object();
     _serverEndPoint = serverEndPoint;
     _eventListener = eventListener;
     _setting = setting ?? new RemotingClientSetting();
     _tcpClient = new TcpSocketClient(_setting.LocalEndPoint, serverEndPoint, ReceiveReplyMessage, this);
     _responseFutureDict = new ConcurrentDictionary<long, ResponseFuture>();
     _replyMessageQueue = new BlockingCollection<byte[]>(new ConcurrentQueue<byte[]>());
     _scheduleService = ObjectContainer.Resolve<IScheduleService>();
     _worker = new Worker("SocketRemotingClient.HandleReplyMessage", HandleReplyMessage);
     _logger = ObjectContainer.Resolve<ILoggerFactory>().Create(GetType().FullName);
 }
コード例 #2
0
 public SocketRemotingClient(IPEndPoint serverEndPoint, RemotingClientSetting setting = null, ISocketClientEventListener eventListener = null)
 {
     _sync               = new object();
     _serverEndPoint     = serverEndPoint;
     _eventListener      = eventListener;
     _setting            = setting ?? new RemotingClientSetting();
     _tcpClient          = new TcpSocketClient(_setting.LocalEndPoint, serverEndPoint, ReceiveReplyMessage, this);
     _responseFutureDict = new ConcurrentDictionary <long, ResponseFuture>();
     _replyMessageQueue  = new BlockingCollection <byte[]>(new ConcurrentQueue <byte[]>());
     _scheduleService    = ObjectContainer.Resolve <IScheduleService>();
     _worker             = new Worker("SocketRemotingClient.HandleReplyMessage", HandleReplyMessage);
     _logger             = ObjectContainer.Resolve <ILoggerFactory>().Create(GetType().FullName);
 }