Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

added x86_64 build architecture and method to send messages synchrono…

…usly.
  • Loading branch information...
commit 23da4adcff92d98548b95104f634d2e4c105c84c 1 parent 93679e7
Tim Burks authored

Showing 3 changed files with 23 additions and 0 deletions. Show diff stats Hide diff stats

  1. +2 0  Nukefile
  2. +3 0  example/Nukefile
  3. +18 0 objc/NuSMTP.m
2  Nukefile
@@ -16,6 +16,8 @@
16 16 (set @framework "NuSMTP")
17 17 (set @framework_identifier "nu.programming.smtp")
18 18 (set @framework_creator_code "????")
  19 +(set @arch (list "x86_64" "i386"))
  20 +
19 21
20 22 (set @cflags "-g -fobjc-gc -std=gnu99 -I Source")
21 23
3  example/Nukefile
@@ -4,6 +4,9 @@
4 4 (set @nu_files (filelist "^nu/.*nu$"))
5 5 (set @resources (filelist "^resources/rule30.jpg$"))
6 6
  7 +(set @arch (list "x86_64" "i386"))
  8 +
  9 +
7 10 ;; application description
8 11 (set @application "SMTPTestApp")
9 12 (set @application_identifier "nu.programming.SMTPTestApp")
18 objc/NuSMTP.m
@@ -12,6 +12,7 @@
12 12 @interface NuSMTPMessage : NSObject <SKPSMTPMessageDelegate>
13 13 {
14 14 SKPSMTPMessage* msg;
  15 + int completed;
15 16 }
16 17
17 18 - (id) initWithFromEmail:(NSString*)fromEmail
@@ -42,6 +43,8 @@ - (id) initWithFromEmail:(NSString*)fromEmail
42 43
43 44 if (self)
44 45 {
  46 + completed = NO;
  47 +
45 48 msg = [[SKPSMTPMessage alloc] init];
46 49
47 50 msg.fromEmail = fromEmail;
@@ -97,7 +100,11 @@ - (void) setValidateSSLChain:(BOOL)validateFlag
97 100 // Delegate methods
98 101 - (void)messageSent:(SKPSMTPMessage *)message
99 102 {
  103 + assert(msg == message);
100 104 [message release];
  105 + msg = nil;
  106 +
  107 + completed = YES;
101 108
102 109 NSLog(@"delegate - message sent");
103 110 }
@@ -105,6 +112,8 @@ - (void)messageSent:(SKPSMTPMessage *)message
105 112 - (void)messageFailed:(SKPSMTPMessage *)message error:(NSError *)error
106 113 {
107 114 [message release];
  115 + assert(msg == message);
  116 + msg = nil;
108 117
109 118 NSLog(@"delegate - error(%d): %@", [error code], [error localizedDescription]);
110 119 }
@@ -144,4 +153,13 @@ - (int) send
144 153 return [msg send];
145 154 }
146 155
  156 +- (int) sendSynchronously
  157 +{
  158 + [msg send];
  159 + while (msg) {
  160 + [[NSRunLoop mainRunLoop] runUntilDate:[NSDate distantPast]];
  161 + }
  162 + return completed;
  163 +}
  164 +
147 165 @end

0 comments on commit 23da4ad

Please sign in to comment.
Something went wrong with that request. Please try again.