tags:

views:

21

answers:

0

Hi,

I would have to design a job scheduling system which works like - users (clients) would deposit jobs (executables) to a server. I have three files - client.c, jobQ.c and server.c. The jobQ would take client requests, and send them to the server on specific timestamps (if a user wants to run job X on server Y at 07-29-2010 3:34 AM, then the jobQ would store it in a stack, and when time comes and if the server is free, it sends the job to the server).

jobQ.c would act as a server for client.c and as a client for server.c. I have used TCP/IP sockets to program these, and the problem I am facing is while creating multiple sockets in jobQ.c. Is it possible for the same file to have client and server sockets? The error points to this line in jobQ.c:

sockSer = socket(AF_INET, SOCK_STREAM, 0);

error: lvalue required as decrement operand

...when I am opening a second socket to talk to the server.

My idea is that jobQ would open different ports to listen to clients and connect to the server.

Thanks,
Sayan