User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11

Thread: Lacewing message headers

  1. #1
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lacewing message headers

    I have developed C++ multithreaded server for MooClick and want to update it for Lacewing. However, the docs I have found does not seem to be correct as for the headers.
    It says that the message type is followed by the size, however:
    Connectin request:
    0
    0
    11 /lenght is on the third byte
    0
    ...

    Name set request:
    0
    4 /name lenght is on the second byte
    1 / I guess that is the type?
    ...

    So obviously there is a difference so I would need to handle incoming connection request differently, but it looks weird. Also the docs says that server replies with 0 to connction request but it does not work if I send just one byte-0..

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Are you using the latest docs?
    https://github.com/udp/lacewing/blob...rrent_spec.txt
    Also, you can use the 0.2.x branch to use the Relay classes instead of writing them yourself:
    https://github.com/udp/lacewing/tree/0.2.x

    I would use the existing 0.2.x version.
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks LB, however it is the same documentation.
    It does say that requesting message starts with 0 (request) and then specific request type (0 for connection): It could be what I am receving from MMF when it connects - 0,0,11...
    However, name request is 1 and so I would expect 0,1,LENGHT but I receive 0,LENGHT,1.

  4. #4
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Blizna View Post
    I would expect 0,1,LENGHT but I receive 0,LENGHT,1.
    Quote Originally Posted by Specification
    All messages sent or received are prefixed with a header containing the type
    of the message, followed by the size (in bytes) of the message
    . This is
    only used by the binary protocol; there is no header for HTTP messages
    beyond the type being sent as the first array element.
    This is the "0,Length" - the 0 refers to 2.1.0, Request - this is all just the header. After the header you should see a 1 for SetName, followed by the name.

    In total the message should look like 0,Len,1,"name"

    As for your first post:
    Quote Originally Posted by Blizna View Post
    It says that the message type is followed by the size, however:
    Connectin request:
    0
    0
    11 /lenght is on the third byte
    0
    ...
    Quote Originally Posted by Specification
    As soon as the TCP connection is established, the client
    should send a single byte of 0 to identify themselves
    as a non-HTTP client. After this, they may start
    exchanging messages, of which the Connect request should
    be the first
    .
    So 0 is sent on initial connection, then actual relay messages are sent.

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LB, thank you, I see my English is still far from perfect when it comes to understanding technical stuff.
    So if I understand it correctly, I am recieveing connection and connection request combined together, that is why it beings with 0,0,LENGHT,TYPE..How to resolve appending then, if it is just one byte?

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Blizna View Post
    How to resolve appending then, if it is just one byte?
    What do you mean?

  7. #7
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well I think the connection request is appended and comes together with the "connection request" message, right? That is why the message starts with 0,0,length,0 because as you said, the lenght should be on the second byte. But then it is hard to use switch on third byte as in that case, it would be 11.
    Or the other way around, why am I receieving 0,0,11,0... as a first message, it does not fit the format.

  8. #8
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    0 is sent as soon as connection is established to indicate that the client is not an HTTP client. After this, normal Relay protocol messages are sent following the format in the specification. That first 0 is not part of the format, it is used to differentiate incoming HTTP clients from incoming binary clients.

    I don't know what you mean by saying you receive them as part of the same message - socket protocol doesn't have a concept of messages, so they could be separate messages which you are interprting as one message. This is why a size identifier is sent - so you know how many bytes to wait for.

  9. #9
    Clicker Fusion 2.5Fusion 2.5+ DLC

    Join Date
    Jun 2006
    Posts
    888
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    LB: well I do recieve it as one packet (will check the code, maybe I am buffering too short messages). When debugging, I do not recieve just 0 but 0,0,11,0,.... so it is obviously that 0 for differentiation from HTTP client and then the message as connection request.

  10. #10
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    One packet != one message

Page 1 of 2 1 2 LastLast

Similar Threads

  1. List Box with Columns and Headers?
    By Soilydude in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 1st June 2013, 04:23 AM
  2. Where to get the newest Lacewing and docs (headers)?
    By Blizna in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 4th March 2013, 07:26 AM
  3. Problem with Headers game online movement.
    By JosephFTaylor in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 20th May 2010, 07:36 AM
  4. [Source] Headers for a 3D pathfinding extension
    By LIJI in forum Extension Development
    Replies: 5
    Last Post: 3rd November 2006, 12:18 PM

Posting Permissions

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