not trying to be rude, but you are making these beginner mistakes because you are still ignoring the advice Ken and I gave you in another thread - use RA provided application Sockets sample from the TN that you already have.
BTW, there is also full blown TCP server code available in KB. It has all housekeeping and fault handling logic and can handle 19 clients (EWEB limit)
Also you will find Open Sockets AOIs that will save you time