SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Member
    Join Date
    May 2013
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ch5: cannot log session data

    Hi,

    When I log into the application instead of the console printing the session information (as on page 98) I only get the following:

    Code:
    debug - served static content /socket.io.js
    It does not even print any other debug messages I place within the io.set authorization function. Excuse any ignorance here, I am very new to this and the debug message is not at all informative. Only thing I have modified is the version of socket.io to 0.9.14. I am still trying to connect to http://localhost, adding the port makes no difference nor does using the javascript url string document.location.href. Unfortunately I do not know enough to know where else to look (obviously I have confirmed the code correct to that of the authors).

    Any help would be appreciated. Cheers.

  2. #2
    SitePoint Member
    Join Date
    May 2013
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok let me rephrase that, it works on the local machine but not from another. So I cannot initiate chat from multiple machines. I get the above when attempting to connect from another machine. Sorry I usually run all my server code on a server and connect to it to simulate a live app/site where possible. Turns out it works fine from the local machine... perhaps this is beyond the scope of the book then?

  3. #3
    SitePoint Member
    Join Date
    May 2013
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So it either works locally or on external machines but not both depending on the url and port you connect too (either localhost for local, or the server_iport for external). Forget the above sorry, clearly just a config thing.

  4. #4
    SitePoint Author
    Join Date
    Nov 2012
    Posts
    48
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Hi Le Pants, you got it! :-)

  5. #5
    SitePoint Member
    Join Date
    May 2013
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the prompt response Don, nice to see an Author who takes ongoing an interest in their work.

    Why I'm here just a note on page 107, the call to sendTrades should occur after the map function to ensure you have the init and stock fields set if I'm not mistaken (it is written before in both the text and the accompanying code thus you will not get the same printout as on page 109).

  6. #6
    SitePoint Author
    Join Date
    Nov 2012
    Posts
    48
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    With reference to the following

    https://github.com/spbooks/NODEJS1/b...lib/nocklib.js

    sendTrades sends the information to the client. The mapping function stores the information on the server in the database. So in this particular case the order does not matter because the client does not need any of the transformations from the mapping. However it is good to see you are reading closely and thinking about the code!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •