The TCP/IP block is probably not supported for code-generation, which is why you don't see it in the generated code (do you see any warning in the MATLAB command window about it?)
If you know how to implement the TCP/IP communication in C code, you can use the Legacy Code Tool to generate an S-function and TLC-file (which is needed for code-generation) that will act as your custom block.