public void Test() { _requestReceived = new ManualResetEvent(false); /*setup + start listening*/ var stub = new SipReceivedMessageProcessorStub(OnRequestReceived, (s,e) => { }); var listeningPoint = new IPEndPoint(TestConstants.MyIpAddress, 33333); var f = new SipFactory(); var stp = new SmartThreadPool(); stp.Start(); var provider = new SipContextSource(listeningPoint, stp); provider.AddListener(null); provider.Start(); /*send a message to the listener*/ var send = new SipRequestBuilder().Build(); var requestBytes = SipFormatter.FormatMessage(send); var udpClient = new UdpClient(); udpClient.Send(requestBytes, requestBytes.Length, listeningPoint); _requestReceived.WaitOne(); var oc = ObjectComparer.Create(); var received = stub.Requests.First(); oc.Compare(received, send); Assert.True(oc.Differences.Count == 0, oc.DifferencesString); }
public ISipProvider CreateSipProvider(SipListeningPoint listeningPoint) { Check.Require(listeningPoint, "listeningPoint"); var contextSource = new SipContextSource( listeningPoint, CreateThreadPool(), CreateMessageFactory(), CreateHeaderFactory()); var sipProvider = new SipProvider(this, contextSource); return(sipProvider); }
public ISipProvider CreateSipProvider(SipListeningPoint listeningPoint) { Check.Require(listeningPoint, "listeningPoint"); var contextSource = new SipContextSource( listeningPoint, CreateThreadPool(), CreateMessageFactory(), CreateHeaderFactory()); var sipProvider = new SipProvider(this, contextSource); return sipProvider; }