# XML Socket Server Problems

**URL:** <https://forum.kirupa.com/t/xml-socket-server-problems/177215>\
**Category:** programming\
**Created:** [January 31, 2006, 3:53am UTC](https://forum.kirupa.com/t/xml-socket-server-problems/177215 "2006-01-31T03:53:48Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fydus](https://avatars.discourse-cdn.com/v4/letter/f/8c91f0/32.png) [@Fydus](https://forum.kirupa.com/u/Fydus)\
**Post date:** [January 31, 2006, 3:53am UTC](https://forum.kirupa.com/t/xml-socket-server-problems/177215/1 "2006-01-31T03:53:48Z")

</div>

I made a mini echo server in Java that accepts clients, gets information, then pushes the information out the buffer to each client. I used flash as the chat client that connects to the server.

Problem:  
When I send a message from flash, my server recieves the message, pushes it out of the buffer. But flash doesn’t get it immediately. I have to send another message to the server for me to receive the first message I sent.

I made sure that when the server sends the message back out that it flushes correctly.

## in flash i send the message like this…

var msg:String = “Check”;

## send(msg+" ");

and in the Server side…

* * *

msg = in.readLine();

## Enumeration c = userList.elements(); System.out.println("Global message: " + messageOut); do { Users t = (Users) c.nextElement(); Client m = (Client)t.thread; m.out.println(messageOut); m.out.flush(); } while(c.hasMoreElements());

I tried to cheat my own server by sending messages through flash like this…

* * *

## var msg:String = “check”; send(msg); send(" ");

And it works just fine like that.

Anyway I can fix it to where I only need to send one message?

Thanks

If you need the source code just ask and I’ll post it.
