BLIP/Demo/BLIPEchoClient.h
author Jens Alfke <jens@mooseyard.com>
Fri Jul 24 14:06:28 2009 -0700 (2009-07-24)
changeset 63 5e4855a592ee
parent 7 5936db2c1987
permissions -rw-r--r--
* The BLIPConnection receivedRequest: delegate method now returns BOOL. If the method returns NO (or if the method isn't implemented in the delegate), that means it didn't handle the message at all; an error will be returned to the sender.
* If the connection closes unexpectedly due to an error, then the auto-generated responses to pending requests will contain that error. This makes it easier to display a meaningful error message in the handler for the request.
     1 //
     2 //  BLIPEchoClient.h
     3 //  MYNetwork
     4 //
     5 //  Created by Jens Alfke on 5/24/08.
     6 //  Copyright 2008 Jens Alfke. All rights reserved.
     7 //  Adapted from Apple sample code "CocoaEcho":
     8 //  http://developer.apple.com/samplecode/CocoaEcho/index.html
     9 //
    10 
    11 #import <Cocoa/Cocoa.h>
    12 #import "BLIPConnection.h"
    13 @class MYBonjourBrowser;
    14 
    15 
    16 @interface BLIPEchoClient : NSObject <BLIPConnectionDelegate>
    17 {
    18     IBOutlet NSTextField * inputField;
    19     IBOutlet NSTextField * responseField;
    20     IBOutlet NSTableView * serverTableView;
    21     
    22     MYBonjourBrowser * _serviceBrowser;
    23     BLIPConnection *_connection;
    24 }
    25 
    26 @property (readonly) MYBonjourBrowser *serviceBrowser;
    27 @property (readonly) NSArray *serviceList;
    28 
    29 - (IBAction)serverClicked:(id)sender;
    30 - (IBAction)sendText:(id)sender;
    31 
    32 @end