资源简介

WCF netTcpBinding 双工通信 实时连接断开检测的简单示例

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Net;
namespace Client
{
    class Program
    {
        static void Main(string[] args)
        {
            InstanceContext instanceContext = new InstanceContext(new CalculateCallBack());
            using (Client.ServiceReference1.IserviceClient proxy = new Client.ServiceReference1.IserviceClient(instanceContext “NetTcpBinding_Iservice“))
            {
                proxy.Init();
                Console.WriteLine(“连接成功!!“);
                Console.ReadLine();
            }
        }
    }

    public class CalculateCallBack : Client.ServiceReference1.IserviceCallback
    {
        int i = 1;
        public void Display(string s)
        {

            Console.WriteLine(“服务器判断{0}<5  客户端接收到此信息{1}“si++);
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       1602  2010-06-10 11:21  Push_Server\Client\app.config

     文件       6656  2010-06-10 15:17  Push_Server\Client\bin\Debug\Client.exe

     文件       1602  2010-06-10 11:21  Push_Server\Client\bin\Debug\Client.exe.config

     文件      15872  2010-06-10 15:17  Push_Server\Client\bin\Debug\Client.pdb

     文件      14328  2010-06-12 16:52  Push_Server\Client\bin\Debug\Client.vshost.exe

     文件       1602  2010-06-10 11:21  Push_Server\Client\bin\Debug\Client.vshost.exe.config

     文件        490  2007-07-21 01:33  Push_Server\Client\bin\Debug\Client.vshost.exe.manifest

     文件       3773  2010-06-09 16:25  Push_Server\Client\Client.csproj

     文件        936  2010-06-12 16:52  Push_Server\Client\obj\Debug\Client.csproj.FileListAbsolute.txt

     文件       6656  2010-06-10 15:17  Push_Server\Client\obj\Debug\Client.exe

     文件      15872  2010-06-10 15:17  Push_Server\Client\obj\Debug\Client.pdb

     文件       4608  2010-06-09 16:25  Push_Server\Client\obj\Debug\TempPE\Service References.ServiceReference1.Reference.cs.dll

     文件        940  2010-06-08 16:52  Push_Server\Client\Program.cs

     文件       1344  2010-06-08 15:34  Push_Server\Client\Properties\AssemblyInfo.cs

     文件       2255  2010-06-09 16:25  Push_Server\Client\Service References\ServiceReference1\configuration.svcinfo

     文件       2997  2010-06-09 16:25  Push_Server\Client\Service References\ServiceReference1\Reference.cs

     文件       1715  2010-06-09 16:25  Push_Server\Client\Service References\ServiceReference1\Reference.svcmap

     文件       3306  2010-06-09 16:25  Push_Server\Client\Service References\ServiceReference1\service.wsdl

     文件        542  2010-06-09 16:25  Push_Server\Client\Service References\ServiceReference1\service.xsd

     文件       2491  2010-06-09 16:25  Push_Server\Client\Service References\ServiceReference1\service1.xsd

     文件       1738  2010-06-10 15:14  Push_Server\ConsoleApplication1\app.config

     文件      27648  2010-06-10 15:14  Push_Server\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe

     文件       1738  2010-06-10 15:14  Push_Server\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe.config

     文件      77312  2010-06-10 15:14  Push_Server\ConsoleApplication1\bin\Debug\ConsoleApplication1.pdb

     文件      14328  2010-06-10 15:14  Push_Server\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe

     文件       1738  2010-06-10 15:14  Push_Server\ConsoleApplication1\bin\Debug\ConsoleApplication1.vshost.exe.config

     文件       5207  2010-06-10 15:14  Push_Server\ConsoleApplication1\ConsoleApplication1.csproj

     文件        554  2010-06-10 15:14  Push_Server\ConsoleApplication1\obj\Debug\ConsoleApplication1.csproj.FileListAbsolute.txt

     文件      27648  2010-06-10 15:14  Push_Server\ConsoleApplication1\obj\Debug\ConsoleApplication1.exe

     文件      77312  2010-06-10 15:14  Push_Server\ConsoleApplication1\obj\Debug\ConsoleApplication1.pdb

............此处省略84个文件信息

评论

共有 条评论