/// <summary>
/// This method captures ASSOCIATE packets and extracts the origin <see cref="Address"/>.
/// </summary>
/// <param name="b">Inbound <see cref="ByteString"/> received from network.</param>
/// <returns></returns>
private Address PeekOrigin(ByteString b)
{
try
{
var pdu = Codec.DecodePdu(b);
if (pdu is Associate)
{
return(pdu.AsInstanceOf <Associate>().Info.Origin);
}
return(null);
}
catch
{
// This layer should not care about malformed packets. Also, this also useful for testing, because
// arbitrary payload could be passed in
return(null);
}
}