Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

How to set TCPClient() Buffer Size?

2021-05-14
2021-05-19
  • sinameshksar - 2021-05-14

    Hello Codesys Community,

    I implemented a simple TCP Client application using the TCPClient() ST function based on Halcon project(attached). It works fine with smaller packets of data but if I try to send messages larger than 56KB it stops working properly. Any idea what it can be?
    To me I need to increase the size of the TCP buffer but not sure how it should be done?

    Regards,
    Sina

     
  • kzuidberg - 2021-05-19

    Hello Sina,

    I also had to check for a possible solution but at another website I found something which might be helpfull in getting your problem solved:

    https://stackoverflow.com/questions/2533988/how-much-buffer-does-networkstream-and-tcpclient-have

    I saw in your program you do a single TCPRead. If the complete message isn't received in the hardware buffer yet, you have to repeat it until the NULL characters is received.

    Hope this helps.

     

Log in to post a comment.