Send and recive command arguments trough Winsock (TCP) - Client & server
Posted on 2003-11-13
I need a two programs that read, send and save command arguments - server and client.
The client: (client.exe)
Read argument from external program, send the argument to the server. Recive string from the server and save returned data to a file - overwrite to the file every time.
I got a script program(procom) that sends out an argument to the client.exe file ex: "client.exe 1234 4321"
The client should then send the "1234 4321" argument to the server.
The server: (server.exe)
The server.exe file should then recive and give the argument string "1234 4321" to an other program.exe, ex: "program.exe 1234 4321"
the program.exe returns a string - the server should then recive this and return it to the client.exe - the client.exe shuld then write this string to a file ex: "string.txt" localy
The command arguments that's used now. ex: program.exe 1234 4321>string.txt
the string.txt file is now moved to the computer.
The hard part:
The server.exe must recive multiple connections. Up to 25 clients. -
It shuld check if the data was sendt correctly.
How far am I?
I have used the Winsock and got connections on my local computer. (client / server)
I have used the command() to get the argument from the external program (program.exe)
I can send the argument string from the client.exe to the server.exe winsock1.senddata
I can recive the argument in the server.exe - winsock1.getdata