Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send and receive Java objects over Sockets?

I'm coding a concurrent ATM application having a Client and a Server.

I need to know how Socket programming can be used in this to call Server methods (request for his current balance, transfer funds etc) and get Objects returned to Client.

I do not want just to pass text using System.out.println like mentioned in Lesson: All About Sockets

like image 462
coder9 Avatar asked Apr 27 '26 10:04

coder9


1 Answers

You should use Javas RMI Lib for this.

You can find a small example here: http://download.oracle.com/javase/1.3/docs/guide/rmi/getstart.doc.html

like image 156
ashiaka Avatar answered May 01 '26 14:05

ashiaka