verrry weird socket error

i have a server no gui just runs from command line

all it does is accept an connection create an thread for that connection and every time the client sends a message displays that message + says with thread is handing that connection

now this works fine and when testing it using the simple client here

http://java.sun.com/developer/onlineTraining/Programming/BasicJava2/socket.html

it works fine each connection is added and if i open like 10 clients and send data from each one the server displays each thread number correct and the data correct

now the problem

i wrote an client using normal java application window like above and this also worked fine

i have recently changed it to an APPLET this is were the trouble starts

evert time i open my new client applet the server adds the connection fine

i can even open another 3 or 4 and they all get added correctly

BUT

when i send data it only sends the data to the last opened connection so all of my clients seam to be chatting to the last opened connection on the server

and when i shut them down the server does not seam to see they are dead UNTILL the very last client is shut down

befor on the

http://java.sun.com/developer/onlineTraining/Programming/BasicJava2/socket.html

when u shut each client down the server would shut each connection thread as well

some things gone weird when swapping over to applets

after writing all that for a laugh i thought id test my program using the appletviewer not just compiling n clicking the html (way i have been)

and hey presto works fine

so y does it work properly on appletviewer and not from the html

is the browser hurting the socket connections some how

when this is all done id like to host it on the net but if it does not work on html it wont work ?

or will it some how be happy once both applet and server are both online on some proper java server ?

any ideas

[2013 byte] By [izrussa] at [2007-11-26 18:44:17]
# 1
> all of my clients seam to be chatting to the last opened connection on the serverAre those clients from a same host, with same local address and local port?
hiwaa at 2007-7-9 6:18:12 > top of Java-index,Java Essentials,New To Java...
# 2

dunno i was just clicking on html file making loads of windows

each window been a new client

im guessing u cant do that as it cant keep track of the connections

but appletviewer can handle this

so when running properly over the net each connnection will be on a diffent pc so will not have this error ?

russdxa at 2007-7-9 6:18:12 > top of Java-index,Java Essentials,New To Java...