in reply to Why my socket is not send and receive data???

The protocol shouldn't be configurable. Or if it is, you need a *lot* more work. Your code assumes UDP is used.

To also allow TCP, you'd have to specify Listen when you create the socket, you'd have to use accept on the socket to wait for a connection, and you'd have to use sysread and syswrite instead of recv and send.

Update: I'm so used to seeing TCP code, I first assumed the OP was using TCP.