You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Utilising Span and Memory to dramatically reduce the allocations
2
+
Version 8 contains substantial refactoring to take advantage of [System.IO.Pipelines](https://www.nuget.org/packages/System.IO.Pipelines/) in an effort to improve throughput performance and reduce memory allocations.
3
+
4
+
In addition to this there are also changes to make service resolution easier via Dependency Injection through utilizing the [IServiceProvider](https://docs.microsoft.com/en-us/dotnet/api/system.iserviceprovider) interface.
4
5
5
6
## Performance
6
-
The *Send* test is the resul of having a basic SmtpServer configuration and sending a 143kb email that was take from the Enron Corpus.
7
+
The throuhput performance and memory allocation of version 7.2 and version 8 were benchmarked using [BenchmarkDotNet](https://www.nuget.org/packages/BenchmarkDotNet/). The benchmark consisted of a single *Send* test which is the result of having a basic SmtpServer configuration and sending a 143kb email that was take from the Enron Corpus dataset.
7
8
8
9
### Version 7.2
9
10
@@ -17,7 +18,29 @@ The *Send* test is the resul of having a basic SmtpServer configuration and send
| Send | 2.204 ms | 0.0307 ms | 0.0287 ms | 11.7188 | - | - | 41.91 KB |
19
20
20
-
## Extensibility
21
-
ISmtpCommandFactory
22
-
- add Sample for overriding Greeting
21
+
## Breaking Changes
22
+
There are a number of breaking changes from v7.
23
+
24
+
### SmtpServerOptionsBuilder
25
+
The SmtpServerOptionsBuilder is now used to configure the SMTP Server options only and the extensibility services such as IMessageStore, IMailboxFilter, IUserAuthenticator, and IEndpointListener have now been removed from the SmtpServerOptionsBuilder.
26
+
27
+
### Extensibility Services
28
+
29
+
#### Service Configuration
30
+
The extensibility services such as IMessageStore, IMailboxFilter, IUserAuthenticator, and IEndpointListener are now resolved internally via an instance of [IServiceProvider](https://docs.microsoft.com/en-us/dotnet/api/system.iserviceprovider). This makes it easier to support Dependency Injection, however, there is a default implementation of the [IServiceProvider](https://docs.microsoft.com/en-us/dotnet/api/system.iserviceprovider) included that will just resolve the specific instances required for the SmtpServer. The [IServiceProvider](https://docs.microsoft.com/en-us/dotnet/api/system.iserviceprovider) instance is a constructor parameter on the SmtpServer instance.
31
+
32
+
#### Service Resolution
33
+
The IMessageStore, IMailboxFilter, and IUserAuthenticator instances were previously resolved by calling the appropriate CreateInstance method on the instance factory, for example, IMessageStoreFactory, IMailboxFilterFactory, and IUserAuthenticatorFactory.
34
+
35
+
#### IMessageStore
36
+
The IMessageStore interface has a breaking change to the SaveAsync method. The message contents is now included as a [ReadOnlySequence<byte>](https://docs.microsoft.com/en-us/dotnet/api/system.buffers.readonlysequence-1) buffer parameter on the method.
37
+
38
+
```csharp
39
+
Task<SmtpResponse>SaveAsync(
40
+
ISessionContextcontext,
41
+
IMessageTransactiontransaction,
42
+
ReadOnlySequence<byte>buffer,
43
+
CancellationTokencancellationToken);
44
+
```
23
45
46
+
This is the exact buffer that is read from the input stream so care must be taken when using it. It must not be referenced and used outside of the scope of this method.
0 commit comments