Пример #1
0
 public WebsocketTopicClient(Uri uri, DelegateConnected connected, CompletionQueue completion_queue)
 {
     message_client = new WebsocketMessageClient(
         uri, WebsocketTopicServer.protocol, connected, MessageWaiting, completion_queue);
     topic_client = new TopicClient(message_client);
     this.completion_queue = completion_queue;
 }
Пример #2
0
 public TcpTopicClientSAE(IPEndPoint ipEndPoint, DelegateConnected connected, 
     CompletionQueue completion_queue)
 {
     message_client = new TcpMessageClientSAE(
         ipEndPoint, connected, MessageWaiting, completion_queue);
     topic_client = new TopicClient(message_client);
     this.completion_queue = completion_queue;
 }
Пример #3
0
 public TcpConnectSAE(Socket socket, IPEndPoint remote, DelegateConnected connected)
 {
     if (null == socket) throw new ArgumentException();
     this.socket = socket;
     if (null == remote) throw new ArgumentException();
     if (null == connected) throw new ArgumentException();
     this.connected = connected;
     SocketAsyncEventArgs sae = new SocketAsyncEventArgs();
     sae.Completed += sae_Completed;
     sae.RemoteEndPoint = remote;
     socket.ConnectAsync(sae);
 }
Пример #4
0
 public void Connect(IPEndPoint ipEndPoint, DelegateConnected connected_callback)
 {
     if (connected)
         throw new ArgumentException("Connect already called");
     else
     {
         connected = true;
         client = new TcpTopicClientIAR(
             ipEndPoint, connected_callback, completion_queue);
         ThreadPool.QueueUserWorkItem(FlushProc);
     }
 }
Пример #5
0
 public TcpMessageClientIAR(IPEndPoint server, DelegateConnected connected_callback,
     DelegateMessageWaiting message_callback, CompletionQueue completion_queue)
 {
     send_queue = new SendQueue(completion_queue, new TcpSendIAR(client, completion_queue));
     if (null == server) throw new ArgumentException();
     this.server = server;
     if (null == connected_callback) throw new ArgumentException();
     this.OnConnected = connected_callback;
     if (null == message_callback) throw new ArgumentException();
     this.OnMessageWaiting = message_callback;
     if (null == message_callback) throw new ArgumentException();
     this.completion_queue = completion_queue;
     new TcpConnectIAR(client, server, ConnectedThread);
 }
Пример #6
0
 public TcpMessageClient(IPEndPoint server, DelegateConnected connected_callback,
     DelegateMessageWaiting message_callback, CompletionQueue completion_queue, DelegateFactoryTcpReader factoryTcpReader)
 {
     send_queue = new SendQueue(completion_queue, new TcpSendIAR(client, completion_queue));
     if (null == server) throw new ArgumentException();
     this.server = server;
     if (null == connected_callback) throw new ArgumentException();
     this.OnConnected = connected_callback;
     if (null == message_callback) throw new ArgumentException();
     this.OnMessageWaiting = message_callback;
     if (null == message_callback) throw new ArgumentException();
     this.completion_queue = completion_queue;
     if (null == factoryTcpReader) throw new ArgumentException();
     this.factoryTcpReader = factoryTcpReader;
     SocketAsyncEventArgs connectAsyncEventArgs = new SocketAsyncEventArgs();
     connectAsyncEventArgs.RemoteEndPoint = server;
     connectAsyncEventArgs.Completed += connectAsyncEventArgs_Completed;
     client.ConnectAsync(connectAsyncEventArgs);
 }