+1 vote

When using same instance of the Pop3 class, can I call GetHeadersByUID() on different threads? In other words, is GetHeadersByUID thread safe?

The same question for GetMessageByUID, GetHeadersByNumber, GetMessageByNumber.

The documentation does mention anything about thread safety.

by (460 points)

1 Answer

+1 vote
 
Best answer

No, those calls are not thread-safe.

Each Pop3 instance represents a single TCP/IP connection to the server.

You should not use the same Pop3 instance from many threads at once.

However you can create as many Pop3 instances as you want, in as many threads you want. Please note that the server may disconnect you, if you abuse its limits.

by (300k points)
selected by
...