Results 1 to 4 of 4

Thread: Winsock Trouble

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    3

    Winsock Trouble

    Hello, im new to these forums, but, im not new to VB. I used to use planetsourcecode as a forum site for VB, but, for some reason their link to get on the forums isnt working, so, I found some place which seems better.

    Neways, I used Winsock a few times to create simple chat programs. My problem is, thats all I can do is send simple text to add the the textbox. I dont know how to send information so that I could, perhaps, add their username to a listbox, or, send coordinates so that the other person's client could move an image across the form. If anyone could explain the fundamentals of how this works, and give me an example, that would be great. Thank you
    Shaun

  2. #2
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Winsock Trouble

    Quote Originally Posted by Hate_Theory
    Hello, im new to these forums, but, im not new to VB. I used to use planetsourcecode as a forum site for VB, but, for some reason their link to get on the forums isnt working, so, I found some place which seems better.

    Neways, I used Winsock a few times to create simple chat programs. My problem is, thats all I can do is send simple text to add the the textbox. I dont know how to send information so that I could, perhaps, add their username to a listbox, or, send coordinates so that the other person's client could move an image across the form. If anyone could explain the fundamentals of how this works, and give me an example, that would be great. Thank you
    Shaun
    Hey welcome to the forums,

    The reason i think you have had a delay ina reply is this is the wrong forum for future winsock and n-tier questions

    http://www.vbforums.com/forumdisplay.php?f=64

    Anyways to your problem, once you can send simple text you can do anything. Its all about how the server interprets the 'dimple' text that matters.

    Lets say we are sending a username and password to the server for validation heres what would happen.

    Assume we are connected

    > Client sends - "*,Pino,Password" - Notice the asterix, (you can use any character) this will let the server know what we will be doing (in our case sending a username and password)

    > Server scans all incomming data for the first character using the left() function (http://www.vbforums.com/showpost.php...28&postcount=3) we can then use somthing like this

    VB Code:
    1. Select case myData
    2.  
    3. Case "*"
    4. 'validate password
    5. case "¬"
    6.  
    7.  
    8. 'user has left
    9. Case "~"  
    10.  
    11.  
    12. ' user had died
    13. end select

    etc etc

    So you see its not How you send the data that matters its how you inrepret it at the other end.

    This may help explain it as well

    http://winsockvb.com/article.php?article_id=25&page=1

    I hope that answers your question,

    if you are struggling in any way please post back

    Pino

  3. #3

    Thread Starter
    New Member
    Join Date
    Feb 2005
    Posts
    3

    Re: Winsock Trouble

    Pino, thanx for the help man, that was a great deminstration. I figured thats how it would work, but, I wasnt too sure so I thought I would double up and ask. Thanx again for all your help
    Shaun

  4. #4
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Winsock Trouble

    Quote Originally Posted by Hate_Theory
    Pino, thanx for the help man, that was a great deminstration. I figured thats how it would work, but, I wasnt too sure so I thought I would double up and ask. Thanx again for all your help
    Shaun
    Hey,

    No probs, if you could edit the first post and add [resolved] to the title that would be great

    And welcome to the forums

Posting Permissions

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



Click Here to Expand Forum to Full Width