I have a client and a server. They communicate through a socket, created with this command:
socket(AF_INET, SOCK_STREAM, 0);
The communication between them goes good.
I want to create a third program that poses as the server and send fake messages to the client. This program have to use the socket that client and server had been created previously.
I am using the send command with the socket id set up statically by mine
write(socket_number,message,1024);
but it doesn't work (and I'm not sure that is the right way).
So I've tried with telnet and nc (on the client port), but I can't send messages to the client.
Have you any ideas...