The cross-platform tool to work with remote connection using sockets
Project description
PSocket
The cross-platform simple tool to work with remote server through sockets. It can establish socket connection to a remote host:port, send commands and receive response. No need to send byte-string. Use usual strings to send command.
Installation
For most users, the recommended method to install is via pip:
pip install psocket
or from source:
python setup.py install
Import
from psocket import SocketClient
Usage
from psocket import SocketClient
client = SocketClient(host='172.16.0.48', port=3261)
print(client)
from psocket import SocketClient
client = SocketClient(host='172.16.0.48', port=3261)
print(client.send_command('<commands>'))
Changelog
1.0.2 (15.01.2020)
Added "initialize" param to the constructor
1.0.1 (15.01.2020)
- "is_host_available()" renamed to "is_socket_available()" and updated
- used external logger from "plogger" package
1.0.0a4 (15.01.2020)
- added init docstring
- init notation changed:
- host is string
- port is integer
1.0.0a3 (14.01.2020)
- removed timeout from socket connection
- greeting and socket_response now are private methods
1.0.0a2 (13.01.2020)
Reverted "client". Now it is an attribute again to keep session alive
1.0.0a1 (13.01.2020)
- Now connection creates with client property
- New methods added:
- is_host_available()
- get_sock_name()
- get_peer_name()
1.0.0a0 (13.01.2020)
- initial commit
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
psocket-1.0.2.post0.tar.gz
(3.6 kB
view hashes)
Built Distribution
Close
Hashes for psocket-1.0.2.post0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | effd834985a7896cdff6271abe2fbe5b94a6c0170f53a569d4ca03587eadc3da |
|
MD5 | 070dd927a41d23c1557a0c23ff8f95bc |
|
BLAKE2b-256 | b9e17717c5bd8764679e94503181569112a6f5211b507ba02bbd60fc3d371298 |