Commit b23cc15d3bdb38b77c7c885cfe0791ae71965922
1 parent
582b767a
git-svn-id: svn://imanolbarba.net/PAD@44 c2ee353e-ed0d-4329-bf56-03aec153487f
Showing
4 changed files
with
3 additions
and
8 deletions
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,19 +8,14 @@ public class JChat | ||
8 | { | 8 | { |
9 | String ip; | 9 | String ip; |
10 | int port, roomSize; | 10 | int port, roomSize; |
11 | - /*Scanner in = new Scanner(System.in); | 11 | + Scanner in = new Scanner(System.in); |
12 | System.out.print("IP: "); | 12 | System.out.print("IP: "); |
13 | ip = in.nextLine(); | 13 | ip = in.nextLine(); |
14 | System.out.print("Port: "); | 14 | System.out.print("Port: "); |
15 | port = in.nextInt(); | 15 | port = in.nextInt(); |
16 | System.out.print("Size of chatroom: "); | 16 | System.out.print("Size of chatroom: "); |
17 | roomSize = in.nextInt(); | 17 | roomSize = in.nextInt(); |
18 | - in.close();*/ | ||
19 | - | ||
20 | - ip = "localhost"; | ||
21 | - port = 3001; | ||
22 | - roomSize = 5; | ||
23 | - | 18 | + in.close(); |
24 | final Server serv = new Server(ip,port,roomSize); | 19 | final Server serv = new Server(ip,port,roomSize); |
25 | Runtime.getRuntime().addShutdownHook(new Thread() | 20 | Runtime.getRuntime().addShutdownHook(new Thread() |
26 | { | 21 | { |
QChatClient/chatroom.cpp
@@ -48,7 +48,6 @@ void sendThread(Socket* s, Chatroom* chat) | @@ -48,7 +48,6 @@ void sendThread(Socket* s, Chatroom* chat) | ||
48 | { | 48 | { |
49 | break; | 49 | break; |
50 | } | 50 | } |
51 | - | ||
52 | } | 51 | } |
53 | catch(SocketException& e) | 52 | catch(SocketException& e) |
54 | { | 53 | { |
@@ -389,6 +388,7 @@ void Chatroom::startSession() | @@ -389,6 +388,7 @@ void Chatroom::startSession() | ||
389 | Chatroom::~Chatroom() | 388 | Chatroom::~Chatroom() |
390 | { | 389 | { |
391 | delete msgLock; | 390 | delete msgLock; |
391 | + delete chatLock; | ||
392 | delete recv; | 392 | delete recv; |
393 | delete send; | 393 | delete send; |
394 | map<string,void*>::iterator it; | 394 | map<string,void*>::iterator it; |