HeWhoIs
March 25th, 2008, 08:51 PM
I'm currently working on an IM program, and just am just starting work on the program's server. I don't really have much experience with network programming, and had a couple of questions.
First of all, is it practical to run a separate thread for each user? In not, is there really any alternative? (I'm using TCP.) If it matters, it's a P2P server, so it just performs various utilities. The actual individual messages are sent via direct connections between users.
Which brings me to my other question: It's my understanding that a connection is defined by *both* endpoints, not just one. That is, two separate connections on a single port will not interfere with each other. (Assuming that the opposite endpoints are unique) Is this true?
First of all, is it practical to run a separate thread for each user? In not, is there really any alternative? (I'm using TCP.) If it matters, it's a P2P server, so it just performs various utilities. The actual individual messages are sent via direct connections between users.
Which brings me to my other question: It's my understanding that a connection is defined by *both* endpoints, not just one. That is, two separate connections on a single port will not interfere with each other. (Assuming that the opposite endpoints are unique) Is this true?