lichat tcp client

1.0.0

A simple TCP client implementation for lichat

Table of Contents

About Lichat-TCP-Client

This is a simple, threaded, TCP-based client for the Lichat protocol.

How To

Create a new client instance and pass it whatever settings you would like.

(defvar *client* (make-instance 'lichat-tcp-client:client))

Notable initargs of potential interest are:

Once a client exists, it can be started to attempt a connection to the server.

(lichat-tcp-client:open-connection *client*)

The client logs information via Verbose. If you set the REPL level to :trace you should see a bunch of status messages being printed every now and again.

Once you're done with the client, you can shut it down again.

(lichat-tcp-client:close-connection *client*)

Naturally this client doesn't really do much on its own. You can send updates to the server with s:

(lichat-tcp-client:s *client* 'create :channel "test")
(lichat-tcp-client:s *client* 'message :channel "test" :text "Hey.")

If you would like to respond to updates that the server sends back, you can define a method on process to do so.

(defmethod lichat-tcp-client:process ((update lichat-protocol:join) (client lichat-tcp-client:client))
  (lichat-tcp-client:s client 'message
                       :channel (lichat-protocol:channel update)
                       :text "What's up everyone?"))

See the Lichat protocol for more information on the available updates, their arguments, and their behaviour.

Mini Client

You can also try a minimal sample client by calling mini-client. The client is meant to illustrate simple use of the library, so make sure to check out its source file, mini.lisp.

Also See

System Information

1.0.0
Yukari Hafner
zlib

Definition Index