Download the PHP package mzohaibnaz/neosocket without Composer

On this page you can find all versions of the php package mzohaibnaz/neosocket. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package neosocket

NeoSocket - (PHP)

NeoSocket is a very simple and lite library that can help you to manage your socket logics. if you are using NeoSocket you should use NeoSocket - JS Client for complete solution package.

Installation

How to use

Initializing NeoSocket

Initializing NeoSocket using SocketManager class

Setup your socket

setup method will bind your socket on host localhost with port 6940 setup take 1 parameter as callback function

Binding Socket to host/port

bind socket on different host and port using create method create take 2 parameter as (host, port)

Setup events

After socket is setup now setup all your events inside it. For setup events use on method. on method take 2 parameter (event_name, callback_function)

setup event with anonymous function

Default Event Types

NeoSocket library using 2 event types as default types to notify develop for new connection and disconnection of user.

New Connection

connection event-type take 2 parameters in callback

Example for new connection
On user disconnected

disconnected event-type take 2 parameters in callback

Example for disconnected

Run socket after setup

run method is used to actually run your socket server after all events are setup.

Example

Data Sending

send method is used to send data on events. send method take 1 parameter as data ( string / array )

send data to other event

event method used to select event-type before sending data on it. event method take 1 parameter as event type

send data to specific client

client method used to select client before sending data on it. client method take 1 parameter as client uid

Get all clients with attributes

getClients is used to get list of all active clients in socket with their attributes

Set client custom attributes

addAttr will help you to add attributes to your client object for additional information storage. addAttr take 2 parameters as key and value of an attribute.

Note: before adding attribute select client by clientByAttr method.

  • Example code

Get client by attribute

clientByAttr is used to select client like client method but by its attribute value. clientByAttr takes 3 parameters as mention below

Note: if searched result is multiple code will select the very first matched client.

Example Code

Reset Instance References

reset method is used to reset selected event/client for that current socket reference within on method

Dismiss Client

dismiss method used to disconnect client from socket. dismiss method take 1 parameter as client uid

License

MIT


All versions of neosocket with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mzohaibnaz/neosocket contains the following files

Loading the files please wait ....