[prog] a simple chat program using cnaiapi

cafeine cafeine at no-log.org
Sat Oct 15 12:06:19 EST 2005


Aslı  <gosalyn at gmail.com> writes:

> hey,

Hi,

> i'm trying to write a simple chat program using the cnaiapi library. I
> have two clints talking to each other. What the server does is taking
> the 1st client's message and delivering it to the second one, and also
> taking the 2nd client's message and delivering it to the 1st one.

[snip]

> after the compilations, I'm running the server program as   .\chatserver 23000
> and the client programs as                                            
>  .\chatclient localhost 23000
> so, I'm using three different terminals to test my application.


I don't know cnaiapi at all, but if you're running your server and your
clients on the same machine, and each one is using the same port things
might get messy. Or maybe your connection object can handle multiple
requests and I'm missing the point...


> The problem is this:
> After running the server application, I execute the first client's
> application, and I get both these messages although I havent executed
> the second clients application yet.
> Chat connection with the first client is established
> Chat connection with the second client is established
>
> I couldnt understand why the second await_contact function does not
> wait for my second client to make a connection..
>
> Thanks in advance for your help..

Just my 2 cents...

-- 
"Men get defensive when women critique their oppressive and sexist
behaviors. Rather than listening and benefiting from criticism, a
defensive stance is taken and women's voices are ignored once again."
-Angela Beallor



More information about the Programming mailing list