I've attempted to write a binding project for this project:
https://github.com/tolo/HHServices

The Project uses the lower level C class : #include <dns_sd.h>. I dont know
how to import this into my binding project.

All the classes that I need to bind are fine, with the exception of this
one:
#import <Foundation/Foundation.h>
#include <dns_sd.h>                       // Note this!

@interface HHServiceSupport : NSObject {
    @private
        CFRunLoopRef runLoop;
    @protected
        DNSServiceRef sdRef;
}

@property (nonatomic, readonly) DNSServiceRef sdRef;

@property (nonatomic, assign) DNSServiceErrorType lastError;
@property (nonatomic, readonly) BOOL hasFailed;

- (void) doDestroy;
- (void) dnsServiceError:(DNSServiceErrorType)error;

- (void) openConnection;
- (void) closeConnection;

@end


My binding for this looks like:

        [BaseType (typeof(NSObject))]
        interface HHServiceSupport
        {

//    @private
//        CFRunLoopRef runLoop;
//    @protected
//        DNSServiceRef sdRef;


                //Do I bind the above??!


//@property (nonatomic, readonly) DNSServiceRef sdRef;
                [Export("sdRef")]
                DNSServiceRef SDRef { get; set; }

//@property (nonatomic, assign) DNSServiceErrorType lastError;
                [Export("lastError")]
                DNSServiceErrorType LastError { get; set; }

//@property (nonatomic, readonly) BOOL hasFailed;
                [Export("hasFailed")]
                bool HasFailed { get; set; }

//- (void) doDestroy;
                [Export("doDestroy")]
                void  DoDestroy();

//- (void) dnsServiceError:(DNSServiceErrorType)error;
                [Export("dnsServiceError:")]
                void  DnsServiceError(DNSServiceErrorType error);

//- (void) openConnection;
                [Export("openConnection")]
                void  OpenConnection();

//- (void) closeConnection;
                [Export("closeConnection")]
                void  CloseConnection();

        }


Because I dont know how to reference the c library dns_sd.h, I dont have any
reference to classes such as DNSServiceRef, DNSServiceErrorType and so on.

Any assistance would be greatly appreciated.

ps: My ultimate goal is to enable peer to peer Bonjour so I can make a TCP
socket connection between devices. I already have the socket code working,
but I need to use GameKit to turn on the network interface, and im having
severe problems with it, plus its messy to be using it just for that.



--
View this message in context: 
http://monotouch.2284126.n4.nabble.com/Binding-question-Referencing-dns-sd-h-tp4656807.html
Sent from the MonoTouch mailing list archive at Nabble.com.
_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to