Skip to content

A highly incomplete chat app written in Swift using Network.framework (client) and Swift NIO (server-side)

License

Notifications You must be signed in to change notification settings

oleh-zayats/NWChat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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!

About

A highly incomplete chat app written in Swift using Network.framework (client) and Swift NIO (server-side)

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages