Giter Site home page Giter Site logo

Comments (3)

bdkjones avatar bdkjones commented on May 9, 2024

Also: I haven't ruled out the possibility that I'm doing something wrong, but I'm pretty sure I've got everything set correctly. Took me about 4 hours to realize it was the server sending dual messages rather than a bug in my javascript on the client side. (I originally started with a fairly complex script and finally got so frustrated, I backed it off to a simple, "Let's just alert the damn message from the server and see if it's even coming through correctly.")

from blwebsocketsserver.

benlodotcom avatar benlodotcom commented on May 9, 2024

I cannot reproduce the issue with my demo code.

Could you replace the - (NSData *)messageForUserWithId:(int)userId method in BLAsyncMessageQueue with the following code and give me the output of the two NSLogs ?

- (NSData *)messageForUserWithId:(int)userId {
    NSData *message;
    @synchronized(self) {
        NSLog(@"BEFORE DEQUEUE %d %@", userId, self.usersMessageQueues[[NSNumber numberWithInt:userId]]);
       message = [self.usersMessageQueues[[NSNumber numberWithInt:userId]] dequeue];
        self.messagesCount--;
        NSLog(@"AFTER DEQUEUE %d %@", userId, self.usersMessageQueues[[NSNumber numberWithInt:userId]]);
    }
    return message;
}

from blwebsocketsserver.

bdkjones avatar bdkjones commented on May 9, 2024

For the record, this was related to ARC.

Enabling the correct ARC flag for the file solved the problem.

from blwebsocketsserver.

Related Issues (11)

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.