Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/Client/smalltalkClient.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
package client;
package Client;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

import server.ClientThread;


public class SmalltalkClient implements Runnable{
public class SmallTalkClient implements Runnable{

static int clientPort;
static int serverPort = 4242; //Random port number
Expand All @@ -17,7 +15,7 @@ public class SmalltalkClient implements Runnable{
private Thread thread = null;
private DataInputStream console = null;
private DataOutputStream streamOut = null;
private ClientThread client = null;
private Server.ClientThread client = null;


public static void main(String[] args) {
Expand All @@ -29,7 +27,7 @@ public static void main(String[] args) {
* - Logging in
* - Creating new account
*/
SmalltalkClient client = new SmalltalkClient();
SmallTalkClient client = new SmallTalkClient();

}

Expand All @@ -41,7 +39,7 @@ public static void openLoginWindow() {
* Constructor for starting server
* Opens the socket at hostName and starts the server
*/
public SmalltalkClient(){
public SmallTalkClient(){
System.out.println("Establishing connection...");
try{
socket = new Socket(hostName, serverPort);
Expand All @@ -60,7 +58,7 @@ public void start() throws IOException{
console = new DataInputStream(System.in);
streamOut = new DataOutputStream(socket.getOutputStream());
if (thread == null){
client = new ClientThread(this, socket);
client = new Server.ClientThread(this, socket);
thread = new Thread(this);
thread.start();
}
Expand All @@ -69,6 +67,7 @@ public void start() throws IOException{
/*
* Method that stops the thread and server
*/
@SuppressWarnings("deprecation")
public void stop() throws IOException{
if(thread != null){
thread.stop();
Expand All @@ -91,6 +90,7 @@ public void stop() throws IOException{
* (non-Javadoc)
* @see java.lang.Runnable#run()
*/
@SuppressWarnings("deprecation")
public void run() {
while(thread != null){
try{
Expand Down
4 changes: 2 additions & 2 deletions src/Common/messageReceiver.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package common;
package Common;

public class MessageReceiver {
public class messageReceiver {

}
8 changes: 4 additions & 4 deletions src/Common/messageSender.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package common;
package Common;

import server.Account;
import Server.Account;

public class MessageSender {
public class messageSender {

public MessageSender(Account[] accounts) {
public messageSender(Account[] accounts) {

}

Expand Down
8 changes: 4 additions & 4 deletions src/Server/ClientThread.java
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
package server;
package Server;

import java.io.DataInputStream;
import java.net.Socket;

import client.SmalltalkClient;
import Client.SmallTalkClient;


public class ClientThread extends Thread{
private Socket socket = null;
private SmalltalkClient client = null;
private SmallTalkClient client = null;
private DataInputStream streamIn = null;

/*
* Constructor for ClientThread
*/
public ClientThread(SmalltalkClient client, Socket socket){
public ClientThread(SmallTalkClient client, Socket socket){
this.client = client;
this.socket = socket;
open();
Expand Down
7 changes: 4 additions & 3 deletions src/Server/SmallChatServer.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package server;
package Server;

import java.net.ServerSocket;
import java.net.Socket;
Expand All @@ -7,7 +7,7 @@ public class SmallChatServer implements Runnable{

private ServerSocket server = null;
private Thread thread = null;
private SmalltalkServer client = null;
private SmallTalkServer client = null;

/*
* Constructor for SmallChatServer
Expand Down Expand Up @@ -37,6 +37,7 @@ private void start(){
/*
* Method that stops the thread
*/
@SuppressWarnings("deprecation")
public void stop(){
if (thread != null){
thread.stop();
Expand Down Expand Up @@ -65,7 +66,7 @@ public void run() {
*/
public void addThread(Socket socket){
System.out.println("Accepting client...");
client = new SmalltalkServer(this, socket);
client = new SmallTalkServer(this, socket);
try{
client.open();
client.start();
Expand Down
2 changes: 1 addition & 1 deletion src/Server/account.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* For existing account information see accounts file.
*/

package server;
package Server;

import java.io.BufferedWriter;
import java.io.File;
Expand Down
2 changes: 1 addition & 1 deletion src/Server/accountHandler.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package server;
package Server;

import java.security.NoSuchAlgorithmException;

Expand Down
6 changes: 3 additions & 3 deletions src/Server/smalltalkServer.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package server;
package Server;

import java.io.BufferedInputStream;
import java.io.DataInputStream;
Expand All @@ -7,7 +7,7 @@
import java.net.DatagramPacket;
import java.net.Socket;

public class SmalltalkServer extends Thread {
public class SmallTalkServer extends Thread {

DatagramPacket pkt;
private Socket socket = null;
Expand All @@ -20,7 +20,7 @@ public class SmalltalkServer extends Thread {
* Constructor for smalltalkServer
* Creates server
*/
public SmalltalkServer(SmallChatServer server, Socket socket) {
public SmallTalkServer(SmallChatServer server, Socket socket) {
this.server = server;
this.socket = socket;
ID = socket.getPort();
Expand Down