Is it possible to send an array through a socket?

Hi,

We’re students from Holland (18 years old) and we’re trying to make a chat-program. Ofcourse a couple of problems have passed our way.

Our server and clients are connected via sockets, and in the client’s interface we wanted a list with the names of the connected users. When the clients connect, their name is sent to the server and stored in an array. After that, this array (with all the names of the clients connected) should be sent to the client, who puts this array in a list.

Then my question: Is it possible to send this array through a socket to a client so this client can work with it? Is this the easiest way or should we look for an other way to do this?

Kind regards,

Marten & Niek

A rather very late response but oh well, one can do only so much. The first thing I’m puzzled about; why even bother with sockets when you (should) have things like RMI at your disposal? Just let Java take care of the communication and focus on allowing your client to access the server processes. I think thats a much better approach than trying to send things over a Socket.