Servers and object sending

Hello everyone. I am looking for some information on how to send objects from a client to a server.Any help would be great. Thank you in advance.
[159 byte] By [TheChatterBoxa] at [2007-10-2 20:07:29]
# 1
Hi,Why have you posted this question in the "Native Methods" forum? Do you want to use native code?Kaj
kajbja at 2007-7-13 22:47:50 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 2

It is not clear which kind of client and server you are having.

But if you are creating Client/Server using Socket Programming then

You can send object by using ObjectOutputStream Class. And the

method is writeObject(Obj).

You can send the object to any destination by using this method.

SandeepSirohia at 2007-7-13 22:47:50 > top of Java-index,Java HotSpot Virtual Machine,Specifications...
# 3

I'm sorry, I should have cleared up what I am trying to do.

What I am currently trying to do is write program similar to that of a chat server.

I currently have it set up so that the client connects to the server (using InetAdresses and sockets), but that is where I hit my problem. I couldn't send Strings back out to the client. Now I will try using the objectOutputStream you suggested. Thank you.

here's an update :

I tried the ObjectOutputStream way, but I'm a little unclear on how to use it. It looks to me like this would be more so used for writing data, where I am looking to send data from one PC (Client 1) to another PC (Host ) then back to another PC (Client 2)

Message was edited by:

TheChatterBox

TheChatterBoxa at 2007-7-13 22:47:50 > top of Java-index,Java HotSpot Virtual Machine,Specifications...