J
juicy
i very blur with the use of writeObject and readObject,
here's the client,
if (b.getLabel() == "write") {
try{
oos.writeObject((Object)event);}//event is button pressed event
oos.flush();
System.out.println("write event");
catch(Exception e){}
if(b.getLabel() == "Read"){
Event get=(Event)iis.readObject();
iis.close();
System.out.println("read event");
and here's the server
try{
ois = new ObjectInputStream(socket.getInputStream());
oos = new ObjectOutputStream(socket.getOutputStream());}
i try to send the button pressed event, the writeObject is ok but the
readObject is blocked. Is the event can't be sent like this? I am just
learning to do that. At server, i need do a function to forward the object
or not?
here's the client,
if (b.getLabel() == "write") {
try{
oos.writeObject((Object)event);}//event is button pressed event
oos.flush();
System.out.println("write event");
catch(Exception e){}
if(b.getLabel() == "Read"){
Event get=(Event)iis.readObject();
iis.close();
System.out.println("read event");
and here's the server
try{
ois = new ObjectInputStream(socket.getInputStream());
oos = new ObjectOutputStream(socket.getOutputStream());}
i try to send the button pressed event, the writeObject is ok but the
readObject is blocked. Is the event can't be sent like this? I am just
learning to do that. At server, i need do a function to forward the object
or not?