摘要:两者都能释放对CPU的使用权,但是在同步域中不表示释放同步域!wait会放弃对象锁而notify不会放弃对象锁,需要通过推出同步代码块,或者调用wait以放弃对象锁,让被唤醒的线程执行------------参考----------------19.4.3 线程让步:Thead.yield()方法当线程在运行中执行了Thread类的yield()静态方法,如果此时具有相同优先级的其他线程处于就绪状态,yield()方法将把当前运行的线程放到可运行池中并使另一个线程运行。如果没有相同优先级的可运行进程,yield()方法什么都不做。下面对19.2.1节的例程19-4的Monkey类的fight(
阅读全文
摘要:服务注册路径问题RouteTable.Routes.Add(new ServiceRoute("Ipc/", hostFactory, typeof(ServiceImp)));RouteTable.Routes.Add(new ServiceRoute("Ipc/LoginService/", hostFactory, typeof(LoginServiceImp)));这样注册的顺序会导致Ipc/LoginService/xxx 发布的终结点找不到,把后一句的移到前面,又正常了RouteTable.Routes.Add(new ServiceRout
阅读全文
摘要:使用uPnP方式在TP-Link上映射端口,配合WCF定时发送动态拨号IP实现远程访问与管理。
阅读全文
摘要:关于UriTemplate通过浏览器直接访问需要使用WebGet标注使用WebInvoke(UriTemplate = "ip/{btime}/{clientId}") 这样的属性时,方法参数列表需要时字符串类型使用ip?btime={bitme}&clientId={clientId} 则可使用对应类型的方法定义即UriTemplate部分的参数需要使用字符串理想而Query部分(?后面)可以使用对应类型关于连接问题测试了下面的代码(使用 netstat -p tcp 查看)View Code static List<object> list = ne
阅读全文
摘要:临时备忘View Code using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using ARSoft.Tools.Net.Dns;using System.Net;using System.Diagnostics;namespace UseT{ public partial class F...
阅读全文
摘要:View Code using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Runtime.InteropServices;using System.Reflection;namespace F.Studio.Common.Cfg{ public class INIHelper { public string FilePath { get; private set; } [DllImport("kernel32")] ...
阅读全文