Results 1 to 3 of 3

Thread: Reliable Communication Between PC

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    Taipei
    Posts
    318

    Post

    I need to send and receive text strings (length up to 10K) to and from, between 2 PC. I tried using 3 party winsocket components etc, and faced with several problems:
    1. Typically, the communication is async, what I need is a sync communication, ie, if machine X sent message to machine Y, then X has to stop processing until Y send result back
    2. Even text string is returned from another machine, people told me that the result may be partial string only (I don't know why), is there any way to make sure that the returning message is complete, if not complete, is there any way to signal an error.

  2. #2
    Junior Member
    Join Date
    Apr 1999
    Location
    Sydney, NSW, Australia
    Posts
    22

    Post

    first of all, the winsock control, under the TCP protocol, strives to ensure that the data is transmitted fully and flawlessly. so, there should be no corruption of the sent data along the network, especially with data sizes of less than 10k.

    secondly, in the dataArrival event of your winsock control(s), you can set a public property/variable to TRUE when the event is triggered by an incoming event. you can then, in your code, say that when this variable is set to TRUE, then don't send the data yet. when the data has been fully sent over, then some other event will be triggered - i forget which (you can check this up in the vb documentation and online help). all you have to do now is to set that variable to equal FALSE, and now when you want to send data, you know that data is not currently being received, and so can send away.

  3. #3
    New Member
    Join Date
    Feb 1999
    Posts
    4

    Post

    Ok, make a global variable to contain the return string, then use this very simple code to hold your app until it has recieved a response

    do while Response = ""
    doevents
    loop

    'I know that this isn't all that you need, but it's better than nothing

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