Giter VIP home page Giter VIP logo

dtbonjour's People

Contributors

maxsz avatar odrobnik avatar wiktor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dtbonjour's Issues

-[DTBonjourDataConnection isOpen] returns false negatives

Currently, -[DTBonjourDataConnection isOpen] checks to see if the input and output streams are both anything but open (if their streamStatus != open, then the method returns NO). This is not the correct behavior.

A more enlightened approach would be to check if the streams are closed:

- (BOOL)isOpen {
    if (!_inputStream) return NO;
    if (!_outputStream) return NO;

    if (NSStreamStatusClosed == _inputStream.streamStatus) return NO;
    if (NSStreamStatusClosed == _outputStream.streamStatus) return NO;

    return YES;
} 

Furthermore, Apple documentation says that specific stream statuses denote that the connection is indeed open and useable, but some form of metadata is being loaded about said connection. The current approach ignores this detail.

Build Issue

When building DTBonjour with Xcode 5.1 there is an "Unknown type name 'CGFloat'"

This is because CGFloat is defined in CoreGraphics. We want the timeout to be a double. So this should be NSTimeInterval instead.

Possible Thread Issue

I'm not sure if this is an issue or I am misunderstanding the way something works.

The following method - (BOOL)sendObject:(id)object error:(NSError **)error
in DTBonjourConnection makes a call to [self _startOutput]; on the Main Thread.

Am I right in thinking that when the data is being written to the output stream that this is happening on the Main Thread? Should this not be happening on a background for performance and parallelization of commands?

isOpen always returns true.

I had the following code in my app:

_dataConnection = [[DTBonjourDataConnection alloc] initWithService:aNetService];

// later

if ( !_dataConnection.isOpen ) {
    if ( ![_dataConnection open] ) {
        NSLog(@"Error: couldn't open connection to net service");
    }
}

After over an hour of trying to figure out why the server wasn't accepting connections, it occurred to me that isOpen might be returning true when I was expecting it to be false. This was indeed the case. In looking at the isOpen code:

- (BOOL)isOpen
{
    return (_inputStream&&_outputStream);
}

_inputStream and _outputStream are initialized in the initWithService constructor, though they are not opened until open is called. This renders isOpen essentially useless. Would not something like this be better?:

- (BOOL)isOpen
{
    return ([_inputStream streamStatus] == NSStreamStatusOpen && 
            [_outputStream streamStatus] == NSStreamStatusOpen);
}

I can submit a pull request if you'd like, I may be overlooking something though so I thought I'd check first.

DTBonjour doesn't build library for Mac

I have a Mac OS X Mountain Lion. When selecting OS X as target, no libDTBonjour library file is produced.

Only when selecting iOS as a target a library file is produced.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.