Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Send an object over a socket between clients

835473May 30 2011 — edited May 31 2011
Dear team,

Let's suppose I have 3 PCs. One creates a (server)socket and the other 2 are connected to it, using its Local IP and they can have a chat.
Example:
192.168.4.1 (it is the "server", it creates the socket and waits for connections. Then, it "broadcasts" the message to all the connected clients.)
192.168.4.2 (a "client", connected to the above by specifying the IP and the port.)
192.168.4.3 (a "client", connected to 192.168.4.1 by specifying the previous IP and the port.)
How I can send an object between the two "clients"? I tried the Serializable interface. It works locally (on the same PC) but when I run it using another IDE or another client it does not work...
Any idea about how can I send an object please?

Thank you in advance!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 28 2011
Added on May 30 2011
20 comments
221 views