Skip to content

Commit

Permalink
Minor bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ThePurpleJedi committed Feb 11, 2022
1 parent 13edfe1 commit 548537d
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 6 deletions.
22 changes: 21 additions & 1 deletion .idea/sonarlint/issuestore/index.pb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified out/production/project-mercurys/com/mercurys/TextClient.class
Binary file not shown.
Binary file modified out/production/project-mercurys/com/mercurys/TextServer.class
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 3 additions & 3 deletions src/com/mercurys/TextClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@ public static void main(final String[] args) {

private static String getHostAddress() {
final Scanner sc = new Scanner(System.in);
System.out.println("Enter server host address [IP] or press 1 for localhost:");
System.out.println("Enter server host IP address or press 1 for default address:");
final String hostAddress = sc.next();
return (hostAddress.equals("1"))? "localhost" : hostAddress;
return (hostAddress.equals("1"))? "192.168.0.151" : hostAddress;
}

private void talk() {
try {
final ReadThread readThread = new ReadThread(this.socket,
"client1" + this.socket.getLocalAddress().toString());
"[MHost" + this.socket.getLocalAddress().toString() + "]");

readThread.start();
this.writeToServer();
Expand Down
4 changes: 2 additions & 2 deletions src/com/mercurys/TextServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class TextServer {

private TextServer(final int port) {
try (final ServerSocket serverSocket = new ServerSocket()) {
serverSocket.bind(new InetSocketAddress("localhost", port));
serverSocket.bind(new InetSocketAddress("192.168.0.151", port));
System.out.println("""
Server initiated.
Waiting for client...""");
Expand All @@ -39,7 +39,7 @@ public static void main(final String[] args) {
private void talk() {
try {
final ReadThread readThread = new ReadThread(this.socket,
"client1" + this.socket.getLocalAddress().toString());
"[MClient1" + this.socket.getInetAddress().toString() + "]");

readThread.start();
this.writeToClient();
Expand Down

0 comments on commit 548537d

Please sign in to comment.