Gestion des fenetres de clavardage
This commit is contained in:
parent
2caf30da03
commit
711cc37040
1 changed files with 5 additions and 3 deletions
|
@ -64,7 +64,7 @@ public class SessionClavardage extends Thread {
|
||||||
public void arretSession() {
|
public void arretSession() {
|
||||||
MessageHorodate msgh = new MessageHorodate(getU2(),getApp().getMe(),".",2);
|
MessageHorodate msgh = new MessageHorodate(getU2(),getApp().getMe(),".",2);
|
||||||
try {
|
try {
|
||||||
getOut().writeObject(msgh);
|
getOut().writeObject(msgh.toString());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -79,7 +79,7 @@ public class SessionClavardage extends Thread {
|
||||||
public void envoiMsg(String msg) {
|
public void envoiMsg(String msg) {
|
||||||
MessageHorodate msgh = new MessageHorodate(getU2(),getApp().getMe(),msg,1);
|
MessageHorodate msgh = new MessageHorodate(getU2(),getApp().getMe(),msg,1);
|
||||||
try {
|
try {
|
||||||
getOut().writeObject(msgh);
|
getOut().writeObject(msgh.toString());
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
|
@ -93,10 +93,12 @@ public class SessionClavardage extends Thread {
|
||||||
|
|
||||||
|
|
||||||
public void run() {
|
public void run() {
|
||||||
|
String plaintext = null;
|
||||||
MessageHorodate msg = null;
|
MessageHorodate msg = null;
|
||||||
while(true) {
|
while(true) {
|
||||||
try {
|
try {
|
||||||
msg = (MessageHorodate) getIn().readObject();
|
plaintext = (String) getIn().readObject();
|
||||||
|
msg = MessageHorodate.stringToMessageHorodate(plaintext);
|
||||||
|
|
||||||
} catch (ClassNotFoundException e) {
|
} catch (ClassNotFoundException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|
Loading…
Reference in a new issue