drewdaman
January 6th, 2005, 10:16 AM
hello everyone,
i need some more advice!
for the project i'm working on, i need to have three things: what i call a camClient, Server and Client. The camClient is a computer with a webcam attached to it. the server is of course the server. and the client is the real client. basically, this should happen: camCleints should connect to the server and send the stream from the webcam to the server. the REAL client must also be able to connect to the server and depending on a selection (of which camera to view) by the real client, the server must forward something coming in from one of the camClients. so,
one of the camClients -> Server -> real Client.
My question is about how to handle the connections for something like this. I know how to connect two things. i guess i will have to use separate sockets for Server-CamClient and Server-Client. But how should i distinguish between them (ie camclient and real client in the server) during the connection phase? I guess one way to do this would simply be to have a recv right after accept and have either type of client send a message identifying themselves. Is there a better way to do this, less error prone and more elegant?
also, just to let you know, i have not made the server multithreaded yet. so, it might not be very easy to have multiple camclients at the moment. but eventually, it will have to be able to do this.
i guess this is more of a "can you please comment" type question than a specific question! all comments appreciated!
thanks in advance!
drew.
i need some more advice!
for the project i'm working on, i need to have three things: what i call a camClient, Server and Client. The camClient is a computer with a webcam attached to it. the server is of course the server. and the client is the real client. basically, this should happen: camCleints should connect to the server and send the stream from the webcam to the server. the REAL client must also be able to connect to the server and depending on a selection (of which camera to view) by the real client, the server must forward something coming in from one of the camClients. so,
one of the camClients -> Server -> real Client.
My question is about how to handle the connections for something like this. I know how to connect two things. i guess i will have to use separate sockets for Server-CamClient and Server-Client. But how should i distinguish between them (ie camclient and real client in the server) during the connection phase? I guess one way to do this would simply be to have a recv right after accept and have either type of client send a message identifying themselves. Is there a better way to do this, less error prone and more elegant?
also, just to let you know, i have not made the server multithreaded yet. so, it might not be very easy to have multiple camclients at the moment. but eventually, it will have to be able to do this.
i guess this is more of a "can you please comment" type question than a specific question! all comments appreciated!
thanks in advance!
drew.