Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link

lucy walters

+ Follow
since Feb 22, 2004
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by lucy walters

hey all..
i figured it all.
hello all,
a small update. could some one pls take a look at my code and point out the run time errors. specs are,
the server has 2 threads: one main and other servant thread. the main thread waits for connection from clients and opens a TCP socket connection. the servant thread waits for UDP packet from client and as soon as it recieves a packet, it sends the message contained in the packet tp all clients using the TCP connection. so, the output stream for each client is held in data structure, so my servant thread iterates thru it and sends the message to all clients.
server code snippets

when 2 clients log in, the message is received by the client that sends it but other client doesn't. but if other client sends any message, it prints the message what other client has sent previously.
i mean,
message from client 1: hello server,
on client 1: from server: hello server
on client 2: (its nothing)
now message from client 2: i am client 2
on client 1: (its nothing)
on client 2: from server: hello server
so is this a problem on client side or server side?
my clien code...

could some one pls show where is my blunder?
thank you
hey all,
this is the specification of my project.
the server waits for client on socket x. as hte client connects, the server shud accept it and create a new socket for client and go back wait for clients.i can't use mutiple thread for each client.
i mean, server waits on socket x, once client connects the server creates a new socket y to handle this client and wait for another client.
how do i do this?. and if i store the output stream for each client in a vector, can i broadcast to all clients from server by iterating thru the vector. is this the best way?
as of now, my implementation is that server accepts all the clients on one socket only and when ever i try to broadcast some message to all clients, it doesn't work so properly.
any help will be appreciated..
thank you