How do you send and recieve multidimensional byte arrays from a client to a server?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Charl Duplessis
    New Member
    • Mar 2011
    • 1

    How do you send and recieve multidimensional byte arrays from a client to a server?

    Hi guys...

    I've posted this question on dreamincode.net but I think I'll find more help here.

    Heres the original post if anyone wants to see it.
    dreamincode.net post

    I'm really just trying to find an extremely simple way to send 3 strings from my client to my server.

    Whatever the server does with those strings afterwards is irrelavent...

    If you need to know: The server will be using the 3 strings to register a user on a mysql db.

    Anyway.. yeah.. my question is:
    How do you send and recieve multidimensiona l byte arrays from a client to a server?
    Last edited by Charl Duplessis; Mar 11 '11, 08:10 PM. Reason: fixed typo
  • GaryTexmo
    Recognized Expert Top Contributor
    • Jul 2009
    • 1501

    #2
    Someone else might be a better choice to answer this since networking is not my strong suit at all! That said, I can try to offer an idea...

    You're in control of what you send and receive over the network, so you can send yourself codes to drive a state machine. Something like...

    * Receiver waiting for data
    * Data received , value of 100. Client interprets this as an array of strings incoming.
    * Next value received, number of string arrays coming
    * Next value, number of characters coming for that string
    * Next n values, characters in that string
    * Repeat last two until you have the required strings
    * Package data and send to appropriate place
    * Reset state back to awaiting command code

    Knowing next to nothing about networking, that's probably how I would approach it. It may not be the best solution ;)

    Comment

    Working...