コード例 #1
0
ファイル: Class5.cs プロジェクト: nistec/MQueue
 public static void SendOut(string request, string hostName, int port, int readTimeout, bool IsAsync, bool enableException = true)
 {
     using (TcpJsonClient client = new TcpJsonClient(hostName, port, readTimeout))
     {
         client.IsDuplex = false;
         client.Execute(request, enableException);
     }
 }
コード例 #2
0
ファイル: Class5.cs プロジェクト: nistec/MQueue
 public static string SendDuplex(string request, string hostName, bool enableException = true)
 {
     using (TcpJsonClient client = new TcpJsonClient(hostName))
     {
         client.IsDuplex = true;
         return(client.Execute(request, enableException));
     }
 }
コード例 #3
0
ファイル: Class5.cs プロジェクト: nistec/MQueue
 public static void SendOut(string request, string hostName, bool enableException = true)
 {
     using (TcpJsonClient client = new TcpJsonClient(hostName))
     {
         client.IsDuplex = false;
         client.Execute(request, enableException);
     }
 }
コード例 #4
0
ファイル: Class5.cs プロジェクト: nistec/MQueue
        //public static T SendDuplex<T>(TcpMessage message, string hostName, int port, int readTimeout, bool IsAsync, bool enableException = true)
        //{
        //    string request = JsonSerializer.Serialize(message);
        //    using (TcpJsonClient client = new TcpJsonClient(hostName, port, readTimeout))
        //    {
        //        client.IsDuplex = true;
        //        string response = client.Execute(request, enableException);
        //        return JsonSerializer.Deserialize<T>(response);
        //    }
        //}

        public static T SendDuplex <T>(string request, string hostName, int port, int readTimeout, bool IsAsync, bool enableException = true)
        {
            using (TcpJsonClient client = new TcpJsonClient(hostName, port, readTimeout))
            {
                client.IsDuplex = true;
                string response = client.Execute(request, enableException);
                return(JsonSerializer.Deserialize <T>(response));
            }
        }
コード例 #5
0
ファイル: Class5.cs プロジェクト: nistec/MQueue
 public static string SendDuplex(string request, string hostAddress, int port, int timeout, bool IsAsync = false, bool enableException = true)
 {
     using (TcpJsonClient client = new TcpJsonClient(hostAddress, port, timeout))
     {
         client.IsAsync  = IsAsync;
         client.IsDuplex = true;
         return(client.Execute(request, enableException));
     }
 }