WIP4
This commit is contained in:
parent
d477d4b4ae
commit
7e9db0d86d
1 changed files with 6 additions and 6 deletions
|
@ -72,7 +72,6 @@ class ReceiveThread extends Thread {
|
|||
{
|
||||
while(!exit)
|
||||
{
|
||||
System.out.println(socket);
|
||||
System.out.println("Waiting for a message");
|
||||
ObjectInputStream in = new ObjectInputStream(socket.getInputStream());
|
||||
System.out.println("Received a message");
|
||||
|
@ -172,7 +171,7 @@ class ConnectionListenerThread extends Thread {
|
|||
if(accepted)
|
||||
{
|
||||
Socket s = (new ServerSocket(1237+(known_users.size()))).accept();
|
||||
ReceiveThread t2 = new ReceiveThread(s, displayArea, known_users, knownUsersPanel, dest_sockets);
|
||||
(new ReceiveThread(s, displayArea, known_users, knownUsersPanel, dest_sockets)).start();
|
||||
dest_sockets.add(s);
|
||||
|
||||
known_users.add(new User(username));
|
||||
|
@ -303,10 +302,11 @@ public class NetworkClient {
|
|||
}
|
||||
for(String a:addressList)
|
||||
{
|
||||
System.out.println("Connecting to " + a + " on port " + (1237+usernameList.length));
|
||||
Socket s = new Socket(a, 1237+usernameList.length);
|
||||
ReceiveThread t2 = new ReceiveThread(s, chatText, known_users, knownUsersPanel, dest_sockets);
|
||||
System.out.println("Connecting to " + a);
|
||||
System.out.println(" on port " + String.valueOf((1237+usernameList.length)));
|
||||
Socket s = new Socket(a, (1237+usernameList.length));
|
||||
dest_sockets.add(s);
|
||||
(new ReceiveThread(s, chatText, known_users, knownUsersPanel, dest_sockets)).start();
|
||||
}
|
||||
Collections.sort(known_users);
|
||||
connected = true;
|
||||
|
@ -377,7 +377,7 @@ public class NetworkClient {
|
|||
{
|
||||
try
|
||||
{
|
||||
// System.out.println(s);
|
||||
System.out.println(s);
|
||||
ObjectOutputStream out = new ObjectOutputStream(s.getOutputStream());
|
||||
out.writeObject(new Message(user.getName(), message));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue