Wish net lib: smtp/ftp -> "Job.Tag"

KMatle

Expert
Licensed User
Longtime User
By sending multiple mails via smtp or uploads via ftp you have to add some logic as the "job-results" come in in random sequence. Using okHttpUtils you can set a Job.Tag to identifiy the job. This would be great in smtp/ftp, too.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
FTP and SMTP, unlike Http, are sequential. This means that requests are handled one after another.

It is true that if you have code such as:
B4X:
For i = 1 To 100
 SMTP.To.Add(...)
 SMTP.Sent
Next
Then it is possible that one message will be sent before the other.

As they are sequential, there is no benefit for sending them like this. You can instead send the next message in the MessageSent event.

There is no object similar to HttpJob here that a tag can be added to it. It is possible to add a Tag parameter to all the methods but I think that it is a bit too much.

It shouldn't be difficult to create a solution similar to HttpJob and HttpUtils2Service for FTP or SMTP. I'm not sure that it will be too useful.
 
Top