Skip to content

Socket server-side built by CocoaAsyncSocket framework written in Swift4.

License

Notifications You must be signed in to change notification settings

iwufan/SocketServerDemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SocketServerDemo

This is a Server-side socket demo built by CocoaAsyncSocket framework written in Swift4. You can download and run it directly.

Usage

image

1. Input a port(it can be any number, client will use this port to connect server.)

2. Click "开始监听".

After the server is connected with a client successfully, it can send messages to the client and receive messages from the client.

Error

I you occur the error "No such module 'CocoaAsyncSocket'" as below.

image

You should know the project can run normally even this error exists.

Here are the methods to solve this error.

First, you should check whether you have installed CocaAsyncSocket framework through cocoapods. If you have CocaAsyncSocket framework in you project, the solution will be very simple, just delete the words 'import CocaAsyncSocket' and type them again. Build the project and the error will disappear.

Other

It's just a basic version. I will add more functions in future, like send images or musics to the client.

Enjoy, thanks.

About

Socket server-side built by CocoaAsyncSocket framework written in Swift4.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published