private void initConnection() throws IOException {
		ObjectOutputStream objectOutputStream = new ObjectOutputStream(getClientSocket().getOutputStream());
		getServer().getClientConnections().add(new ClientConnection(objectOutputStream, getClientSocket()));
		ObjectInputStream objectInputStream = new ObjectInputStream(getClientSocket().getInputStream());

		objectOutputStream.writeObject(new ChatEvent(getServer().getServerUser(), null, Receipient.STATUS, welcomeMsg));
		ChatEvent chatEvent;

		try {
			while ((chatEvent = (ChatEvent) objectInputStream.readObject()) != null) {
				if (!getServer().getUsers().containsKey(chatEvent.getFrom().getUsername())) {
					getServer().getUsers().put(chatEvent.getFrom().getUsername(), chatEvent.getFrom());
				}
				List<ClientConnection> clientConnections = getServer().getClientConnections();
				synchronized (clientConnections) {
					for (ClientConnection clientConnection : clientConnections) {
						if (clientConnection.getClientSocket() == clientSocket) {
							clientConnection.setUser(chatEvent.getFrom());
							break;
						}
					}
				}
				getServer().getNetworkHandler().fireNetworkEvent(new NetworkEvent(NetworkEvents.CHAT_EVENT, chatEvent));
				if (chatEvent.getReceipient() == Receipient.CHANNEL) {
					getServer().broadcastChatEventToClients(chatEvent);
				} else if (chatEvent.getReceipient() == Receipient.QUERY) {
					getServer().sendPrivateChatEvent(chatEvent);
				}
				chatEvent = null;
			}
		} catch (ClassNotFoundException e) {
			System.err.println("CLASS NOT FOUND EXEPTION (serverConnection)");
		}

		objectOutputStream.close();
		objectInputStream.close();
		getClientSocket().close();
	}