You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-11Lines changed: 20 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,21 +7,30 @@ This is a skeleton project for a chat server we'll use to build a chat client an
7
7
8
8
To start we'll work in groups on implementing a very basic server that listens on a socket and routes messages, and a client that can talk to it.
9
9
10
-
Start by implementing the protocol below. Don't worry about concurrency yet! The library included in this skeleton project `clj-sockets` is synchronous, so no need to read up on Clojure concurrency primitives or core.async channels. Start with a synchronous server, and we'll make it async next week.
10
+
Start by implementing the protocol below. We are using a single `ref`to handle shared state. In the future, we will port this code over to use `core.async`
11
11
12
12
### The Protocol
13
13
- It's a line based protocol. Newline signifies end of message
14
-
- channel and nicknames can contain only `[a-z|A-Z|0-9|-+]`,
15
-
- channel names must begin with #,
14
+
- nicknames can contain only `[a-z|A-Z|0-9|-+]`,
16
15
- usernames can begin with any character other then #
17
16
- After connecting, each user sends `USER nickname` as their first command
18
-
- At first there's only one channel, `#general`, we'll add more later!
19
-
- Messaging a user is done with `MSG nickanme message`
20
-
- Messaging a channel is done with `MSG #channel message`
17
+
- Messaging is done with `MSG message`
18
+
21
19
22
20
### Goals for Week 1
23
-
- Get a feel for working with a project larger then one function
24
-
- Write a couple of tests (either with [clojure.test](https://clojure.github.io/clojure/clojure.test-api.html) or [midje](https://github.com/marick/Midje)).
25
-
- Try to practice REPL-driven development
26
-
- Think about how to organize code into namespaces
27
-
- Have fun!!!
21
+
The skeleton code implements a simple chat server. This week you should:
22
+
- Understand the server code (we'll go over it together)
23
+
- Talk to the server using [netcat](http://en.wikipedia.org/wiki/Netcat)
24
+
- Start by writing a separate program to function as a client. It should allow the user to specify a server/port and nickname as command line args (Run `lein new app chat-client` to create a new app skeleton)
25
+
- Implement private messaging in the server
26
+
- Bonus points if the client can connect to multiple servers at once
27
+
28
+
29
+
## Goals for the future
30
+
- Add support for channels, which start with #
31
+
- Automatically place users in #general and allow users to join and leave channels with `JOIN #channel` and `LEAVE #channel`
32
+
- Update messaging syntax to be `MSG #channel message`
33
+
- Devise a mechanism for the client to be on multiple channels at once
34
+
- Add support for changing nicknames
35
+
- Migrate to core.aync
36
+
- Replace sockets with websockets and write a web UI in cljs
0 commit comments