Skip to content

Guide on using the socket #4617

Answered by leocavalcante
karevan asked this question in Q&A
Discussion options

You must be logged in to vote

There are two main differences here

  1. Client vs Server
  2. Socket vs WebSocket

Clients vs Server

The difference here is almost the same difference between a webserver and a web-browser. The server will be up, bound to a host and port, where the client can connect to.

Socket vs WebSocket

Raw sockets over TCP/UPD/Unix are very low-level and doesn't provides some protocol guarantees like WebSocket.
WebSocket is the one where you can access from a web-browser.


Another tip: refer to wiki.swoole.com for the official docs (right-click then Translate to English).

  1. Raw socket:
    1. Coroutine server: https://wiki.swoole.com/#/server/co_init
    2. Coroutine client: https://wiki.swoole.com/#/coroutine_client/init

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@karevan
Comment options

Answer selected by karevan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants