fixed #49
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
package ch.zhaw.pm2.multichat.protocol;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* A Message object represents one Message of a client. Can be stored in ClientMessageList.
|
||||
*/
|
||||
public class Message {
|
||||
public class Message implements Serializable {
|
||||
private final ConnectionHandler.DATA_TYPE type;
|
||||
private String sender;
|
||||
private final String receiver;
|
||||
|
||||
@@ -320,9 +320,9 @@ public class NetworkHandler {
|
||||
* @throws IOException if an error occours. (e.g. terminated locally/remotely) see above.
|
||||
* @throws ClassNotFoundException if the data object received does not match any class in the local classpath
|
||||
*/
|
||||
public T receive() throws IOException, ClassNotFoundException {
|
||||
public Message receive() throws IOException, ClassNotFoundException {
|
||||
ObjectInputStream inputStream = new ObjectInputStream(this.socket.getInputStream());
|
||||
return (T) inputStream.readObject();
|
||||
return (Message) inputStream.readObject();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user