Commit b23cc15d3bdb38b77c7c885cfe0791ae71965922

Authored by Imanol-Mikel Barba Sabariego
1 parent 582b767a

git-svn-id: svn://imanolbarba.net/PAD@44 c2ee353e-ed0d-4329-bf56-03aec153487f

JChatServerV2/bin/pad/prac2/JChat$1.class
No preview for this file type
JChatServerV2/bin/pad/prac2/JChat.class
No preview for this file type
JChatServerV2/src/pad/prac2/JChat.java
... ... @@ -8,19 +8,14 @@ public class JChat
8 8 {
9 9 String ip;
10 10 int port, roomSize;
11   - /*Scanner in = new Scanner(System.in);
  11 + Scanner in = new Scanner(System.in);
12 12 System.out.print("IP: ");
13 13 ip = in.nextLine();
14 14 System.out.print("Port: ");
15 15 port = in.nextInt();
16 16 System.out.print("Size of chatroom: ");
17 17 roomSize = in.nextInt();
18   - in.close();*/
19   -
20   - ip = "localhost";
21   - port = 3001;
22   - roomSize = 5;
23   -
  18 + in.close();
24 19 final Server serv = new Server(ip,port,roomSize);
25 20 Runtime.getRuntime().addShutdownHook(new Thread()
26 21 {
... ...
QChatClient/chatroom.cpp
... ... @@ -48,7 +48,6 @@ void sendThread(Socket* s, Chatroom* chat)
48 48 {
49 49 break;
50 50 }
51   -
52 51 }
53 52 catch(SocketException& e)
54 53 {
... ... @@ -389,6 +388,7 @@ void Chatroom::startSession()
389 388 Chatroom::~Chatroom()
390 389 {
391 390 delete msgLock;
  391 + delete chatLock;
392 392 delete recv;
393 393 delete send;
394 394 map<string,void*>::iterator it;
... ...