Skip to content
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.

joncfoo/pony-simple-chat-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A basic line-oriented chat server built atop step 4 of the pony-workshop used as a learning example.

It features:

  • graceful shutdown of the server (triggered by sending SIGTERM and SIGINT)
  • logging which can be controlled via PONY_LOG_LEVEL environment variable
  • requires clients to provide their names
  • clients can send:
    • /quit - terminate the client's connection to the server and announces that this client has left
    • /time - the server sends the current time to the server
    • everything else is sent to all connected clients

Requirements

Build

ponyc

Run

Note: the server listens for connections on localhost:8989

./main

To run with various log levels:

PONY_LOG_LEVEL=<log-level> ./main

Where <log-level> is one of fine, info, warn, error

Interact

The easiest way to connect to the server is to use netcat like so:

> nc localhost 8989
welcome! Please enter your name:

About

A simple chat server written to learn Pony

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published