Skip to content

Commit

Permalink
added x86_64 build architecture and method to send messages synchrono…
Browse files Browse the repository at this point in the history
…usly.
  • Loading branch information
Tim Burks committed Feb 23, 2010
1 parent 93679e7 commit 23da4ad
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Nukefile
Expand Up @@ -16,6 +16,8 @@
(set @framework "NuSMTP")
(set @framework_identifier "nu.programming.smtp")
(set @framework_creator_code "????")
(set @arch (list "x86_64" "i386"))


(set @cflags "-g -fobjc-gc -std=gnu99 -I Source")

Expand Down
3 changes: 3 additions & 0 deletions example/Nukefile
Expand Up @@ -4,6 +4,9 @@
(set @nu_files (filelist "^nu/.*nu$"))
(set @resources (filelist "^resources/rule30.jpg$"))

(set @arch (list "x86_64" "i386"))


;; application description
(set @application "SMTPTestApp")
(set @application_identifier "nu.programming.SMTPTestApp")
Expand Down
18 changes: 18 additions & 0 deletions objc/NuSMTP.m
Expand Up @@ -12,6 +12,7 @@
@interface NuSMTPMessage : NSObject <SKPSMTPMessageDelegate>
{
SKPSMTPMessage* msg;
int completed;
}

- (id) initWithFromEmail:(NSString*)fromEmail
Expand Down Expand Up @@ -42,6 +43,8 @@ - (id) initWithFromEmail:(NSString*)fromEmail

if (self)
{
completed = NO;

msg = [[SKPSMTPMessage alloc] init];

msg.fromEmail = fromEmail;
Expand Down Expand Up @@ -97,14 +100,20 @@ - (void) setValidateSSLChain:(BOOL)validateFlag
// Delegate methods
- (void)messageSent:(SKPSMTPMessage *)message
{
assert(msg == message);
[message release];
msg = nil;

completed = YES;

NSLog(@"delegate - message sent");
}

- (void)messageFailed:(SKPSMTPMessage *)message error:(NSError *)error
{
[message release];
assert(msg == message);
msg = nil;

NSLog(@"delegate - error(%d): %@", [error code], [error localizedDescription]);
}
Expand Down Expand Up @@ -144,4 +153,13 @@ - (int) send
return [msg send];
}

- (int) sendSynchronously
{
[msg send];
while (msg) {
[[NSRunLoop mainRunLoop] runUntilDate:[NSDate distantPast]];
}
return completed;
}

@end

0 comments on commit 23da4ad

Please sign in to comment.