110,533
社区成员
发帖
与我相关
我的任务
分享
class A{
string Name{get;set;}
A(string a);
B getB(string b);
}
class B{
string Operation();
}
//Contract
[ServiceContract(SessionMode = SessionMode.Required, CallbackContract = typeof(IVideoServiceCallback))]
public interface IVideoService
{
[OperationContract(IsOneWay = true)]
void ProceedVideo(string videopath);
}
//Contract
public interface IVideoServiceCallback
{
[OperationContract]
void FinishProcedure();
}
//Service
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]
public class VideoService:IVideoService
{
public void ProceedVideo(string videopath)
{
string test = videopath;
//callback
IVideoSearviceCallback guest = OperationContext.Current.GetCallbackChannel<IVideoServiceCallback>();
guest.FinishProcedure();
}