public DtlsServer(DatagramTransport datagramTransport, CertificateInfo certificateInfo, DtlsServerProtocol dtlsServerProtocol = null) { DatagramTransport = datagramTransport; this.dtlsServerProtocol = dtlsServerProtocol ?? new DtlsServerProtocol(new Org.BouncyCastle.Security.SecureRandom()); tlsServer = new TlsServerImpl(certificateInfo); tlsServer.ClientCertificateReceived += TlsServer_ClientCertificateReceived; }
public ThreadedAssociation(DatagramTransport transport, AssociationListener al, bool isClient, int srcPort, int destPort) : base(transport, al, isClient, srcPort, destPort) { try { _transpMTU = Math.Min(transport.GetReceiveLimit(), transport.GetSendLimit()); logger.LogDebug("Transport MTU is now " + _transpMTU); } catch (IOException x) { logger.LogWarning("Failed to get suitable transport mtu "); logger.LogWarning(x.ToString()); } _freeBlocks = new Queue <DataChunk>(/*MAXBLOCKS*/); _inFlight = new Dictionary <long, DataChunk>(MAXBLOCKS); for (int i = 0; i < MAXBLOCKS; i++) { DataChunk dc = new DataChunk(); lock (_freeBlocks) { _freeBlocks.Enqueue(dc); } } resetCwnd(); }
public DtlsClient(DatagramTransport datagramTransport, CertificateInfo certificateInfo, DtlsClientProtocol dtlsClientProtocol = null) { this.datagramTransport = datagramTransport; this.dtlsClientProtocol = dtlsClientProtocol ?? new DtlsClientProtocol(new SecureRandom()); tlsClient = new TlsClientImpl(certificateInfo); tlsClient.ServerCertificateInfoAvailable += TlsClient_ServerCertificateInfoAvailable; }
internal Server(DtlsTestCase outer, DtlsServerProtocol serverProtocol, DatagramTransport serverTransport, TlsTestServerImpl serverImpl) { this.mOuter = outer; this.mServerProtocol = serverProtocol; this.mServerTransport = serverTransport; this.mServerImpl = serverImpl; }
public Association(DatagramTransport transport, AssociationListener al, bool client) { //Log.setLevel(Log.ALL); Logger.Debug("Created an Associaction of type: " + this.GetType().Name); _al = al; _random = new SecureRandom(); _myVerTag = _random.NextInt(); _transp = transport; _streams = new Dictionary <int, SCTPStream>(); _outbound = new Dictionary <long, DataChunk>(); _holdingPen = new Dictionary <uint, DataChunk>(); var IInt = new FastBit.Int(_random.NextInt()); _nearTSN = new FastBit.Uint(IInt.b0, IInt.b1, IInt.b2, IInt.b3).Auint; _state = State.CLOSED; if (_transp != null) { startRcv(); } else { Logger.Error("Created an Associaction with a null transport somehow..."); } __assocNo++; /* * the method used to determine which * side uses odd or even is based on the underlying DTLS connection * role: the side acting as the DTLS client MUST use Streams with even * Stream Identifiers, the side acting as the DTLS server MUST use * Streams with odd Stream Identifiers. */ _even = client; }
public UnicastMediaSubsession(bool reuseFirstSource, short initialPortNum = 6970, bool multiplexRTCPWithRTP = false) { // Make sure RTP ports are even-numbered: fInitialPortNum = (short)((initialPortNum + 1) & (~1)); fMultiplexRTCPWithRTP = multiplexRTCPWithRTP; int serverPortNum; for (serverPortNum = fInitialPortNum; ; ++serverPortNum) { // Normal case: We're streaming RTP (over UDP or TCP). Create a pair of // groupsocks(RTP and RTCP), with adjacent port numbers(RTP port number even). // (If we're multiplexing RTCP and RTP over the same port number, it can be odd or even.) // NoReuse dummy(envir()); // ensures that we skip over ports that are already in use ServerRTPPort = serverPortNum; try { _rtpGroupsock = new DatagramTransport(ServerRTPPort, 255); } catch (Exception) { _rtpGroupsock = null; } if (_rtpGroupsock == null) { continue; } if (fMultiplexRTCPWithRTP) { //Use the RTP 'groupsock' object for RTCP as well: ServerRTCPPort = ServerRTPPort; _rtcpGroupsock = _rtpGroupsock; } else { // Create a separate 'groupsock' object(with the next(odd) port number) for RTCP: ServerRTCPPort = ++serverPortNum; try { _rtcpGroupsock = new DatagramTransport(ServerRTCPPort, 255); } catch (Exception) { _rtcpGroupsock = null; } if (_rtcpGroupsock == null) { continue; // try again } } break; // success } }
public virtual DtlsTransport Connect(TlsClient client, DatagramTransport transport) { if (client == null) { throw new ArgumentNullException("client"); } if (transport == null) { throw new ArgumentNullException("transport"); } SecurityParameters securityParameters = new SecurityParameters(); securityParameters.entity = ConnectionEnd.client; ClientHandshakeState state = new ClientHandshakeState(); state.client = client; state.clientContext = new TlsClientContextImpl(mSecureRandom, securityParameters); securityParameters.clientRandom = TlsProtocol.CreateRandomBlock(client.ShouldUseGmtUnixTime(), state.clientContext.NonceRandomGenerator); client.Init(state.clientContext); DtlsRecordLayer recordLayer = new DtlsRecordLayer(transport, state.clientContext, client, ContentType.handshake); TlsSession sessionToResume = state.client.GetSessionToResume(); if (sessionToResume != null) { SessionParameters sessionParameters = sessionToResume.ExportSessionParameters(); if (sessionParameters != null) { state.tlsSession = sessionToResume; state.sessionParameters = sessionParameters; } } try { return(ClientHandshake(state, recordLayer)); } catch (TlsFatalAlert fatalAlert) { recordLayer.Fail(fatalAlert.AlertDescription); throw fatalAlert; } catch (IOException e) { recordLayer.Fail(AlertDescription.internal_error); throw e; } catch (Exception e) { recordLayer.Fail(AlertDescription.internal_error); throw new TlsFatalAlert(AlertDescription.internal_error, e); } }
public virtual DtlsTransport Connect(TlsClient client, DatagramTransport transport) { if (client == null) throw new ArgumentNullException("client"); if (transport == null) throw new ArgumentNullException("transport"); SecurityParameters securityParameters = new SecurityParameters(); securityParameters.entity = ConnectionEnd.client; ClientHandshakeState state = new ClientHandshakeState(); state.client = client; state.clientContext = new TlsClientContextImpl(mSecureRandom, securityParameters); securityParameters.clientRandom = TlsProtocol.CreateRandomBlock(client.ShouldUseGmtUnixTime(), state.clientContext.NonceRandomGenerator); client.Init(state.clientContext); DtlsRecordLayer recordLayer = new DtlsRecordLayer(transport, state.clientContext, client, ContentType.handshake); TlsSession sessionToResume = state.client.GetSessionToResume(); if (sessionToResume != null && sessionToResume.IsResumable) { SessionParameters sessionParameters = sessionToResume.ExportSessionParameters(); if (sessionParameters != null) { state.tlsSession = sessionToResume; state.sessionParameters = sessionParameters; } } try { return ClientHandshake(state, recordLayer); } catch (TlsFatalAlert fatalAlert) { AbortClientHandshake(state, recordLayer, fatalAlert.AlertDescription); throw fatalAlert; } catch (IOException e) { AbortClientHandshake(state, recordLayer, AlertDescription.internal_error); throw e; } catch (Exception e) { AbortClientHandshake(state, recordLayer, AlertDescription.internal_error); throw new TlsFatalAlert(AlertDescription.internal_error, e); } finally { securityParameters.Clear(); } }
public RTPMulticastStream(string name, string subSession, DatagramTransport rtpTransport, DatagramTransport rtcpTransport, string multicastIP, int rtpPort, int rtcpPort) : base(name, subSession, rtpTransport, rtcpTransport) { _rtpPort = rtpPort; _rtcpPort = rtcpPort; _address = IPAddress.Parse(multicastIP); _endPoint = new IPEndPoint(_address, rtpPort); _rtcpTasks.Add(RTCPSender()); _rtcpTasks.Add(RTCPReader()); }
public virtual DtlsTransport Connect(TlsClient client, DatagramTransport transport) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown if (client == null) { throw new ArgumentNullException("client"); } if (transport == null) { throw new ArgumentNullException("transport"); } SecurityParameters securityParameters = new SecurityParameters(); securityParameters.entity = 1; ClientHandshakeState clientHandshakeState = new ClientHandshakeState(); clientHandshakeState.client = client; clientHandshakeState.clientContext = new TlsClientContextImpl(mSecureRandom, securityParameters); securityParameters.clientRandom = TlsProtocol.CreateRandomBlock(client.ShouldUseGmtUnixTime(), clientHandshakeState.clientContext.NonceRandomGenerator); client.Init(clientHandshakeState.clientContext); DtlsRecordLayer dtlsRecordLayer = new DtlsRecordLayer(transport, clientHandshakeState.clientContext, client, 22); TlsSession sessionToResume = clientHandshakeState.client.GetSessionToResume(); if (sessionToResume != null && sessionToResume.IsResumable) { SessionParameters sessionParameters = sessionToResume.ExportSessionParameters(); if (sessionParameters != null) { clientHandshakeState.tlsSession = sessionToResume; clientHandshakeState.sessionParameters = sessionParameters; } } try { return(ClientHandshake(clientHandshakeState, dtlsRecordLayer)); } catch (TlsFatalAlert tlsFatalAlert) { dtlsRecordLayer.Fail(tlsFatalAlert.AlertDescription); throw tlsFatalAlert; } catch (IOException val) { IOException val2 = val; dtlsRecordLayer.Fail(80); throw val2; } catch (global::System.Exception alertCause) { dtlsRecordLayer.Fail(80); throw new TlsFatalAlert(80, alertCause); } }
public virtual DtlsTransport Accept(TlsServer server, DatagramTransport transport) { if (server == null) { throw new ArgumentNullException("server"); } if (transport == null) { throw new ArgumentNullException("transport"); } SecurityParameters securityParameters = new SecurityParameters(); securityParameters.entity = ConnectionEnd.server; ServerHandshakeState state = new ServerHandshakeState(); state.server = server; state.serverContext = new TlsServerContextImpl(mSecureRandom, securityParameters); securityParameters.serverRandom = TlsProtocol.CreateRandomBlock(server.ShouldUseGmtUnixTime(), state.serverContext.NonceRandomGenerator); server.Init(state.serverContext); DtlsRecordLayer recordLayer = new DtlsRecordLayer(transport, state.serverContext, server, ContentType.handshake); server.NotifyCloseHandle(recordLayer); // TODO Need to handle sending of HelloVerifyRequest without entering a full connection try { return(ServerHandshake(state, recordLayer)); } catch (TlsFatalAlert fatalAlert) { AbortServerHandshake(state, recordLayer, fatalAlert.AlertDescription); throw fatalAlert; } catch (IOException e) { AbortServerHandshake(state, recordLayer, AlertDescription.internal_error); throw e; } catch (Exception e) { AbortServerHandshake(state, recordLayer, AlertDescription.internal_error); throw new TlsFatalAlert(AlertDescription.internal_error, e); } finally { securityParameters.Clear(); } }
private DatagramTransport[] mkMockTransports() { BlockingQueue <byte[]> left = new BlockingQueue <byte[]>(); BlockingQueue <byte[]> right = new BlockingQueue <byte[]>(); DatagramTransport[] ret = new DatagramTransport[2]; ret[0] = new MockTransport(left, right); ret[1] = new MockTransport(right, left); __transList.Add(ret[0]); __transList.Add(ret[1]); return(ret); }
internal DtlsRecordLayer(DatagramTransport transport, TlsContext context, TlsPeer peer, byte contentType) { mTransport = transport; mContext = context; mPeer = peer; mInHandshake = true; mCurrentEpoch = new DtlsEpoch(0, new TlsNullCipher(context)); mPendingEpoch = null; mReadEpoch = mCurrentEpoch; mWriteEpoch = mCurrentEpoch; SetPlaintextLimit(16384); }
public virtual DtlsTransport Connect(TlsClient client, DatagramTransport transport) { if (client == null) { throw new ArgumentNullException("client"); } if (transport == null) { throw new ArgumentNullException("transport"); } SecurityParameters securityParameters = new SecurityParameters(); securityParameters.entity = 1; DtlsClientProtocol.ClientHandshakeState clientHandshakeState = new DtlsClientProtocol.ClientHandshakeState(); clientHandshakeState.client = client; clientHandshakeState.clientContext = new TlsClientContextImpl(this.mSecureRandom, securityParameters); securityParameters.clientRandom = TlsProtocol.CreateRandomBlock(client.ShouldUseGmtUnixTime(), clientHandshakeState.clientContext.NonceRandomGenerator); client.Init(clientHandshakeState.clientContext); DtlsRecordLayer dtlsRecordLayer = new DtlsRecordLayer(transport, clientHandshakeState.clientContext, client, 22); TlsSession sessionToResume = clientHandshakeState.client.GetSessionToResume(); if (sessionToResume != null && sessionToResume.IsResumable) { SessionParameters sessionParameters = sessionToResume.ExportSessionParameters(); if (sessionParameters != null) { clientHandshakeState.tlsSession = sessionToResume; clientHandshakeState.sessionParameters = sessionParameters; } } DtlsTransport result; try { result = this.ClientHandshake(clientHandshakeState, dtlsRecordLayer); } catch (TlsFatalAlert tlsFatalAlert) { dtlsRecordLayer.Fail(tlsFatalAlert.AlertDescription); throw tlsFatalAlert; } catch (IOException ex) { dtlsRecordLayer.Fail(80); throw ex; } catch (Exception alertCause) { dtlsRecordLayer.Fail(80); throw new TlsFatalAlert(80, alertCause); } return(result); }
public UnreliableDatagramTransport(DatagramTransport transport, Random random, int percentPacketLossReceiving, int percentPacketLossSending) { if (percentPacketLossReceiving < 0 || percentPacketLossReceiving > 100) throw new ArgumentException("out of range", "percentPacketLossReceiving"); if (percentPacketLossSending < 0 || percentPacketLossSending > 100) throw new ArgumentException("out of range", "percentPacketLossSending"); this.transport = transport; this.random = random; this.percentPacketLossReceiving = percentPacketLossReceiving; this.percentPacketLossSending = percentPacketLossSending; }
private static void SendDatagram(DatagramTransport sender, byte[] buf, int off, int len) { //try //{ // sender.Send(buf, off, len); //} //catch (InterruptedIOException e) //{ // e.bytesTransferred = 0; // throw e; //} sender.Send(buf, off, len); }
internal DtlsRecordLayer(DatagramTransport transport, TlsContext context, TlsPeer peer, byte contentType) { this.mTransport = transport; this.mContext = context; this.mPeer = peer; this.mInHandshake = true; this.mCurrentEpoch = new DtlsEpoch(0, new TlsNullCipher(context)); this.mPendingEpoch = null; this.mReadEpoch = mCurrentEpoch; this.mWriteEpoch = mCurrentEpoch; SetPlaintextLimit(MAX_FRAGMENT_LENGTH); }
/// <summary> /// Starts the SCTP transport receive thread. /// </summary> public void Start(DatagramTransport dtlsTransport, bool isDtlsClient) { if (!_isStarted) { _isStarted = true; transport = dtlsTransport; IsDtlsClient = isDtlsClient; _receiveThread = new Thread(DoReceive); _receiveThread.Name = $"{THREAD_NAME_PREFIX}{RTCSctpAssociation.ID}"; _receiveThread.IsBackground = true; _receiveThread.Start(); } }
public virtual DtlsTransport Accept(TlsServer server, DatagramTransport transport) { if (server == null) throw new ArgumentNullException("server"); if (transport == null) throw new ArgumentNullException("transport"); SecurityParameters securityParameters = new SecurityParameters(); securityParameters.entity = ConnectionEnd.server; ServerHandshakeState state = new ServerHandshakeState(); state.server = server; state.serverContext = new TlsServerContextImpl(mSecureRandom, securityParameters); securityParameters.serverRandom = TlsProtocol.CreateRandomBlock(server.ShouldUseGmtUnixTime(), state.serverContext.NonceRandomGenerator); server.Init(state.serverContext); DtlsRecordLayer recordLayer = new DtlsRecordLayer(transport, state.serverContext, server, ContentType.handshake); // TODO Need to handle sending of HelloVerifyRequest without entering a full connection try { return ServerHandshake(state, recordLayer); } catch (TlsFatalAlert fatalAlert) { AbortServerHandshake(state, recordLayer, fatalAlert.AlertDescription); throw fatalAlert; } catch (IOException e) { AbortServerHandshake(state, recordLayer, AlertDescription.internal_error); throw e; } catch (Exception e) { AbortServerHandshake(state, recordLayer, AlertDescription.internal_error); throw new TlsFatalAlert(AlertDescription.internal_error, e); } finally { securityParameters.Clear(); } }
public UnreliableDatagramTransport(DatagramTransport transport, Random random, int percentPacketLossReceiving, int percentPacketLossSending) { if (percentPacketLossReceiving < 0 || percentPacketLossReceiving > 100) { throw new ArgumentException("out of range", "percentPacketLossReceiving"); } if (percentPacketLossSending < 0 || percentPacketLossSending > 100) { throw new ArgumentException("out of range", "percentPacketLossSending"); } this.transport = transport; this.random = random; this.percentPacketLossReceiving = percentPacketLossReceiving; this.percentPacketLossSending = percentPacketLossSending; }
public virtual DtlsTransport Accept(TlsServer server, DatagramTransport transport) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown if (server == null) { throw new ArgumentNullException("server"); } if (transport == null) { throw new ArgumentNullException("transport"); } SecurityParameters securityParameters = new SecurityParameters(); securityParameters.entity = 0; ServerHandshakeState serverHandshakeState = new ServerHandshakeState(); serverHandshakeState.server = server; serverHandshakeState.serverContext = new TlsServerContextImpl(mSecureRandom, securityParameters); securityParameters.serverRandom = TlsProtocol.CreateRandomBlock(server.ShouldUseGmtUnixTime(), serverHandshakeState.serverContext.NonceRandomGenerator); server.Init(serverHandshakeState.serverContext); DtlsRecordLayer dtlsRecordLayer = new DtlsRecordLayer(transport, serverHandshakeState.serverContext, server, 22); try { return(ServerHandshake(serverHandshakeState, dtlsRecordLayer)); } catch (TlsFatalAlert tlsFatalAlert) { dtlsRecordLayer.Fail(tlsFatalAlert.AlertDescription); throw tlsFatalAlert; } catch (IOException val) { IOException val2 = val; dtlsRecordLayer.Fail(80); throw val2; } catch (global::System.Exception alertCause) { dtlsRecordLayer.Fail(80); throw new TlsFatalAlert(80, alertCause); } }
public static async Task <int> ReceiveAsync(this DatagramTransport transport, byte[] buf, int off, int len) { SpinWait spinWait = new SpinWait(); while (true) { int count = transport.Receive(buf, off, len, 0); if (count == -1) { spinWait.SpinOnce(); await Task.Yield(); } else { Console.WriteLine(count); return(count); } } }
public virtual DtlsTransport Accept(TlsServer server, DatagramTransport transport) { if (server == null) { throw new ArgumentNullException("server"); } if (transport == null) { throw new ArgumentNullException("transport"); } SecurityParameters securityParameters = new SecurityParameters(); securityParameters.entity = 0; DtlsServerProtocol.ServerHandshakeState serverHandshakeState = new DtlsServerProtocol.ServerHandshakeState(); serverHandshakeState.server = server; serverHandshakeState.serverContext = new TlsServerContextImpl(this.mSecureRandom, securityParameters); securityParameters.serverRandom = TlsProtocol.CreateRandomBlock(server.ShouldUseGmtUnixTime(), serverHandshakeState.serverContext.NonceRandomGenerator); server.Init(serverHandshakeState.serverContext); DtlsRecordLayer dtlsRecordLayer = new DtlsRecordLayer(transport, serverHandshakeState.serverContext, server, 22); DtlsTransport result; try { result = this.ServerHandshake(serverHandshakeState, dtlsRecordLayer); } catch (TlsFatalAlert tlsFatalAlert) { dtlsRecordLayer.Fail(tlsFatalAlert.AlertDescription); throw tlsFatalAlert; } catch (IOException ex) { dtlsRecordLayer.Fail(80); throw ex; } catch (Exception alertCause) { dtlsRecordLayer.Fail(80); throw new TlsFatalAlert(80, alertCause); } return(result); }
public void TestClientServer() { SecureRandom secureRandom = new SecureRandom(); DtlsClientProtocol clientProtocol = new DtlsClientProtocol(secureRandom); DtlsServerProtocol serverProtocol = new DtlsServerProtocol(secureRandom); MockDatagramAssociation network = new MockDatagramAssociation(1500); Server server = new Server(serverProtocol, network.Server); Thread serverThread = new Thread(new ThreadStart(server.Run)); serverThread.Start(); DatagramTransport clientTransport = network.Client; clientTransport = new UnreliableDatagramTransport(clientTransport, secureRandom, 0, 0); clientTransport = new LoggingDatagramTransport(clientTransport, Console.Out); MockDtlsClient client = new MockDtlsClient(null); DtlsTransport dtlsClient = clientProtocol.Connect(client, clientTransport); for (int i = 1; i <= 10; ++i) { byte[] data = new byte[i]; Arrays.Fill(data, (byte)i); dtlsClient.Send(data, 0, data.Length); } byte[] buf = new byte[dtlsClient.GetReceiveLimit()]; while (dtlsClient.Receive(buf, 0, buf.Length, 100) >= 0) { } dtlsClient.Close(); server.Shutdown(serverThread); }
public AssociationImpl(DatagramTransport transport, AssociationListener al) : base(transport, al) { }
/// <summary> /// Creates a new SCTP association with the remote peer. /// </summary> /// <param name="dtlsTransport">The DTLS transport to create the association on top of.</param> /// <param name="isClient">True if this peer will be the client within the association. This /// dictates whether streams created use odd or even ID's.</param> /// <param name="srcPort">The source port to use when forming the association.</param> /// <param name="dstPort">The destination port to use when forming the association.</param> public RTCPeerSctpAssociation(DatagramTransport dtlsTransport, bool isClient, int srcPort, int dstPort) { logger.LogDebug($"SCTP creating association is client {isClient} {srcPort}:{dstPort}."); _isClient = isClient; _sctpAssociation = new ThreadedAssociation(dtlsTransport, this, isClient, srcPort, dstPort); }
public MockAssociation(DatagramTransport transport, AssociationListener al) : base(transport, al) { }
public static Task SendAsync(this DatagramTransport transport, byte[] buf, int off, int len) { return(Task.Run(() => transport.Send(buf, off, len))); }
public void RunTest(TlsTestConfig config) { CheckDtlsVersion(config.clientMinimumVersion); CheckDtlsVersion(config.clientOfferVersion); CheckDtlsVersion(config.serverMaximumVersion); CheckDtlsVersion(config.serverMinimumVersion); SecureRandom secureRandom = new SecureRandom(); DtlsClientProtocol clientProtocol = new DtlsClientProtocol(secureRandom); DtlsServerProtocol serverProtocol = new DtlsServerProtocol(secureRandom); MockDatagramAssociation network = new MockDatagramAssociation(1500); TlsTestClientImpl clientImpl = new TlsTestClientImpl(config); TlsTestServerImpl serverImpl = new TlsTestServerImpl(config); Server server = new Server(this, serverProtocol, network.Server, serverImpl); Thread serverThread = new Thread(new ThreadStart(server.Run)); serverThread.Start(); Exception caught = null; try { DatagramTransport clientTransport = network.Client; if (TlsTestConfig.DEBUG) { clientTransport = new LoggingDatagramTransport(clientTransport, Console.Out); } DtlsTransport dtlsClient = clientProtocol.Connect(clientImpl, clientTransport); for (int i = 1; i <= 10; ++i) { byte[] data = new byte[i]; Arrays.Fill(data, (byte)i); dtlsClient.Send(data, 0, data.Length); } byte[] buf = new byte[dtlsClient.GetReceiveLimit()]; while (dtlsClient.Receive(buf, 0, buf.Length, 100) >= 0) { } dtlsClient.Close(); } catch (Exception e) { caught = e; LogException(caught); } server.Shutdown(serverThread); // TODO Add checks that the various streams were closed Assert.AreEqual(config.expectFatalAlertConnectionEnd, clientImpl.FirstFatalAlertConnectionEnd, "Client fatal alert connection end"); Assert.AreEqual(config.expectFatalAlertConnectionEnd, serverImpl.FirstFatalAlertConnectionEnd, "Server fatal alert connection end"); Assert.AreEqual(config.expectFatalAlertDescription, clientImpl.FirstFatalAlertDescription, "Client fatal alert description"); Assert.AreEqual(config.expectFatalAlertDescription, serverImpl.FirstFatalAlertDescription, "Server fatal alert description"); if (config.expectFatalAlertConnectionEnd == -1) { Assert.IsNull(caught, "Unexpected client exception"); Assert.IsNull(server.mCaught, "Unexpected server exception"); } }
// default is server public Association(DatagramTransport transport, AssociationListener al, int srcPort, int dstPort) : this(transport, al, false, srcPort, dstPort) { }
internal Server(DtlsServerProtocol serverProtocol, DatagramTransport serverTransport) { this.mServerProtocol = serverProtocol; this.mServerTransport = serverTransport; }
public LoggingDatagramTransport(DatagramTransport transport, TextWriter output) { this.transport = transport; this.output = output; this.launchTimestamp = DateTimeUtilities.CurrentUnixMs(); }
public AssociationImpl(DatagramTransport transport, AssociationListener al, bool client) : base(transport, al, client) { }