Implementation TCP
This commit is contained in:
parent
aecd3e2692
commit
5a20c9fd06
3 changed files with 3 additions and 1 deletions
Binary file not shown.
Binary file not shown.
|
@ -96,7 +96,7 @@ class RunnerTCPEnvoi implements Runnable {
|
||||||
while(true){
|
while(true){
|
||||||
msg = sc.nextLine();
|
msg = sc.nextLine();
|
||||||
MessageHorodate mh = new MessageHorodate(Destinataire,app.getMe(),msg,1);
|
MessageHorodate mh = new MessageHorodate(Destinataire,app.getMe(),msg,1);
|
||||||
out.println(mh.toString());
|
out.println(msg);
|
||||||
out.flush();
|
out.flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,8 +123,10 @@ class RunnerTCPEcoute implements Runnable {
|
||||||
String line = in.readLine();
|
String line = in.readLine();
|
||||||
String msg = "";
|
String msg = "";
|
||||||
while (line != null) {
|
while (line != null) {
|
||||||
|
|
||||||
//if(!msg.equals("")) {
|
//if(!msg.equals("")) {
|
||||||
System.out.println("Received: "+ line);
|
System.out.println("Received: "+ line);
|
||||||
|
line = in.readLine();
|
||||||
//}
|
//}
|
||||||
/*if((line.split(" ")[0].equals("Destinataire"))) {
|
/*if((line.split(" ")[0].equals("Destinataire"))) {
|
||||||
if(msg != "") {
|
if(msg != "") {
|
||||||
|
|
Loading…
Reference in a new issue