Download the PHP package spatie/simple-tcp-client without Composer
On this page you can find all versions of the php package spatie/simple-tcp-client. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spatie/simple-tcp-client
More information about spatie/simple-tcp-client
Files in spatie/simple-tcp-client
Package simple-tcp-client
Short Description Connect and send data through a TCP connection
License MIT
Homepage https://github.com/spatie/simple-tcp-client
Informations about the package simple-tcp-client
🔌 Connect and send data through a TCP connection
This package provides a simple and elegant way to create TCP connections, send data, and receive responses. Perfect for interacting with TCP servers, testing network services, or building simple network clients.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Installation
You can install the package via composer:
Usage
Here's how you can connect to TCP service:
Sending and receiving data
You can use send
and receive
methods to send and receive data.
By default, we'll read 8192 bytes of data. You can optionally specify the maximum number of bytes to read:
Handling timeouts
The client supports connection timeouts to prevent hanging:
HTTP requests over TCP
Here's a full example where we use all methods.
Testing SMTP connections
Here's how you could connect and communicate with an SMTP server.
Port scanning
In this example, we are going to check if port 53 is open or closed.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Freek Van der Herten
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of simple-tcp-client with dependencies
ext-sockets Version *