-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from iamrohitsuthar/swingintegration
Swingintegration
- Loading branch information
Showing
21 changed files
with
859 additions
and
232 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package com.chatroom.client; | ||
|
||
import java.io.IOException; | ||
import java.io.ObjectInputStream; | ||
import java.io.ObjectOutputStream; | ||
import java.io.PrintWriter; | ||
import java.net.Socket; | ||
|
||
import com.chatroom.others.LogFileWriter; | ||
|
||
public class ClientModel { | ||
private int clientID=-1; | ||
private int roomId = -1; | ||
private String host = ""; | ||
private int port = -1; | ||
public static ObjectOutputStream objectOutputStream; | ||
public static ObjectInputStream objectInputStream; | ||
private Socket socket; | ||
|
||
public ClientModel(String host, int port) { | ||
super(); | ||
this.host = host; | ||
this.port = port; | ||
|
||
// connecting | ||
try { | ||
socket = new Socket(host,port); | ||
objectOutputStream = new ObjectOutputStream(socket.getOutputStream()); | ||
objectInputStream = new ObjectInputStream(socket.getInputStream()); | ||
} catch (IOException e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
public int getClientID() { | ||
return clientID; | ||
} | ||
|
||
public void setClientID(int clientID) { | ||
this.clientID = clientID; | ||
} | ||
|
||
public int getRoomId() { | ||
return roomId; | ||
} | ||
|
||
public void setRoomId(int roomId) { | ||
this.roomId = roomId; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.