Delphi 4 TClientSocket - changes with XP - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Delphi 4 TClientSocket - changes with XP

Russ_TRuss_T Posts: 14Member
Hello,

We have a client program that we run on NT4 boxes and Win9x machines. The client will not however run on XP machines. I have tracked the problem down to the TClientSocket component. It appears that on receiving a large packet it is only partially received.

I can't imagine that in XP there is some imposed limit on the size of the packet which is causing the socket to have problems. Also it appears the size changes.

Does anyone know of any issues with the component related to XP, or an updated equivalent that I can use please.

Thanks

Comments

  • ManningManning Posts: 1,621Member
    : Hello,
    :
    : We have a client program that we run on NT4 boxes and Win9x machines. The client will not however run on XP machines. I have tracked the problem down to the TClientSocket component. It appears that on receiving a large packet it is only partially received.
    :
    : I can't imagine that in XP there is some imposed limit on the size of the packet which is causing the socket to have problems. Also it appears the size changes.
    :
    : Does anyone know of any issues with the component related to XP, or an updated equivalent that I can use please.


    That depends on what you mean by partially received. Because TCP is a streaming protocol, you aren't guaranteed to receive all the data in one try. So if you are only trying to receive data in one call, it is perfectly acceptable for it to only receive part of the data that has been sent. You may need to receive the data in smaller pieces by using several read calls.

    If, however, you are already trying to receive the data many times, and even after a period of time all the data is not received, then there is definitely some other problem.

    In either case, if you don't get it going yourself you'll probably have to post some code so we can see exactly what's going on.
  • Russ_TRuss_T Posts: 14Member
    : That depends on what you mean by partially received. Because TCP is a streaming protocol, you aren't guaranteed to receive all the data in one try. So if you are only trying to receive data in one call, it is perfectly acceptable for it to only receive part of the data that has been sent. You may need to receive the data in smaller pieces by using several read calls.
    :
    : If, however, you are already trying to receive the data many times, and even after a period of time all the data is not received, then there is definitely some other problem.
    :
    : In either case, if you don't get it going yourself you'll probably have to post some code so we can see exactly what's going on.
    :

    Hello Manning, thank you for your help and for help on my previous post.

    Ok here's the strange thing now.

    The event handler for my onRead event for my socket starts with

    gstrBuffer := gstrBuffer + frmMenu.MySocket.Socket.ReceiveText;

    gstrBuffer is a global string variable. This adds data to itself as received and after each read tests to see if its a full packet (in respect of have we received all the data we asked for, only about 1000 chars).

    Now on some receives (specific to certain requests I make) the packet gets
    chars placed in it! These occur at the same places every time, and on the same types of requests. However these requests also occur in other places and work just fine. It's not the server that sends the data, I believe its an XP specific problem. The reason I think this is because our client used to work fine on NT4 and 9x machines. It's bizarre, it really is.

    Has anyone ever had this problem, of course once our 'packet' is fully received each line in the packet gets used for its specific purpose, and with new lines chars appearing in the wrong places the whole thing goes to pot.

    Thanks very much for your time.

    Cheers

Sign In or Register to comment.