Skip to content

Latest commit

 

History

History
31 lines (21 loc) · 1.06 KB

README.md

File metadata and controls

31 lines (21 loc) · 1.06 KB

NWChat

A highly incomplete chat app written in Swift using Network.framework & Streams (client-side) and Swift NIO (server-side)
No 3-rd party libs used, this is a prototype of how chat funtionality is implemented using stream sockets.

alt text

Run this thing:

  1. Clone/download repo

  2. Fetch dependencies and generate project:
    cd .../{project directory}/NIOServer
    $ swift package generate-xcodeproj

  3. Run server
    $ cd .../{project directory}/NIOServer/Sources
    $ open TCPServer.xcodeproj
    build and run ('command + R' or from terminal: ‘$ swift run TCPServer’)

Note: in case you want to kill the process blocking your port:
$ lsof -t -i tcp: | xargs kill (or '$ sudo lsof -t -i tcp: | xargs kill')

  1. Run client:
    $ cd .../{project directory}/Client
    $ open NetworkFrameworkResearch.xcodeproj
    command + R, fill host/port of the server

Run multiple simulators (ex. 7, 7Plus, 8)

Profit!