Hisock

Latest version: v2.0.2

Safety actively analyzes 682361 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

3.0a

**Full Changelog**: https://github.com/SSS-Says-Snek/hisock/compare/2.0.2...3.0a

It's been even longer since the last release! I just realized I had some commits that hadn't made its way over to a new release, so here's version 3. I originally hoped to have a bigger release, but this will do for now. There are a handful of breaking changes and bug fixes here, so listen up!

BREAKING CHANGES
- `dict`s are being phased out in place of `ClientInfo`. The codebase now uses `ClientInfo` extensively in the API, and projects are strongly recommended to follow in that pursuit.
- There have been some name changes for kwargs: I do not remember why I did that.
- **Type casting has been completely revamped!** Previously, in order to convey information, programmers utilized type hints to let hisock automatically know how to cast bytes to and from things. Now, it is automatically done for you! Now, type hints do **NOT** affect the outcome (although you should still type hint your codebase!) Note that this system is new, and there may be bugs.

IMPROVED
- Your usual doc improvements
- Minor codebase changes
- Hisock transitioned away from setup.py to pyproject.toml! This marks the transition into newer and more standard python technology.

BUG FIXES
- Fix bug regarding hisock's inability to send large amounts of data. Now, data above ~50kB at once can actually be sent without potentially crashing.

This is still an alpha release, so if there are bugs, please let us know. Otherwise, see you (maybe) next time!

2.0.2

**Full Changelog**: https://github.com/SSS-Says-Snek/hisock/compare/2.0.1...2.0.2

It's been pretty long since the last release! The only thing this has is an important bug fix.

BUG FIXES
- (SSS-Says-Snek) - Fix handling of the `client_disconnect` event being required for clients (I don't know how long that has gone unnoticed)

OTHER
* Bump pytest from 7.1.3 to 7.2.0 by dependabot in https://github.com/SSS-Says-Snek/hisock/pull/53
* Upgrade CodeSee workflow to version 2 by codesee-maps in https://github.com/SSS-Says-Snek/hisock/pull/55
* Bump pytest from 7.2.0 to 7.2.1 by dependabot in https://github.com/SSS-Says-Snek/hisock/pull/56
* Bump pycryptodome from 3.15.0 to 3.17 by dependabot in https://github.com/SSS-Says-Snek/hisock/pull/57

2.0.1

**Full Changelog**: https://github.com/SSS-Says-Snek/hisock/compare/2.0...2.0.1

With `14` commits, `10` changed files, `171` additions, and `22` deletions, this is hisock's first patch version! There isn't much from this release, although there are some important bug fixes.

BUG FIXES
- ( SSS-Says-Snek ) - Close server if the server raises an exception during runtime.
- ( SSS-Says-Snek ) - Fixed miscellaneous client bugs.
- ( sheepy0125 ) - Allow threaded reserved functions.
- ( sheepy0125 ) - Fix bug involving client disconnects not sending properly.
- ( sheepy0125 ) - Fix closing sometimes raising exceptions.
- ( sheepy0125 ) - Fix some reserved events being treated as normal events.

OTHER
* Bump pytest from 7.1.1 to 7.1.2 by dependabot in https://github.com/SSS-Says-Snek/hisock/pull/50
* Bump pycryptodome from 3.14.1 to 3.15.0 by dependabot in https://github.com/SSS-Says-Snek/hisock/pull/51
* Bump pytest from 7.1.2 to 7.1.3 by dependabot in https://github.com/SSS-Says-Snek/hisock/pull/52

2.0

**Full Changelog**: https://github.com/SSS-Says-Snek/hisock/compare/1.2...2.0

After over two months, we have finally finished the biggest `HiSock` version since v0.0.1: `Version 2.0`! This release is huge, with `174` commits, `52` changed files, `5,464` added lines, and `3,331` deleted lines. A ***HUGE*** shoutout to sheepy0125, as this release wouldn't have been possible without his contributions.

Now, without further ado, let's get into the changelog!

> **NOTE**: As this release is *major*, there are some major API-breaking changes, which are marked with a bold asterisk. Please refer to the newly-updated [documentation](hisock.readthedocs.io) if you have any questions.

MAJOR BREAKING CHANGES
- ( sheepy0125 )**\*** `ThreadedHiSockClient` and `ThreadedHiSockServer`'s `start_client()` and `start_server()` have been renamed to `start()`.
- ( sheepy0125 )**\*** Both of the threaded client's and server's `stop_client()` and `stop_server()` have been renamed to `stop()`.
- ( sheepy0125 )**\*** Both of the threaded client's and server's receive methods have been replaced by `recv()`, also with a new API. Check the documentation and the examples for how to use the new method.

NEW
- ( SSS-Says-Snek ) A new reserved command `*`! This command would be sent whenever a command not handled by a client's functions is detected.
- ( SSS-Says-Snek )**\*** `start()` for `HiSockClient` and `HiSockServer`! Instead of having to program a while loop themselves that calls `update()` or `run()` (which has now been privatized), all you have to do is to call `client.start()` or `server.start()`.
- ( SSS-Says-Snek ) A keepalive for `HiSockServer` has been added! Every minute, the server sends a request to all clients to check whether they are active. If they aren't, they will be disconnected from the server. This functionality can be disabled via a parameter to the constructor.
- ( sheepy0125 ) `on()` has a new parameter `override`. If the event has the same name as a reserved event and this is `True`, it'd behave like a regular event listener.
- ( sheepy0125 ) The client and server now have a callback and error handling system! If a function is passed to the `callback` parameter in `start()`, the function will get called every time the client/server gets "updated" (`_run()` or `_update()` finish). Similarly, if a function is passed to the `error_handler` parameter in `start()`, the function will get called if the client/server ever encounters an exception.
- ( sheepy0125 ) Event listeners now have "dynamic arguments". Check the documentation and the examples for how to use this new feature.

IMPROVED
- ( sheepy0125 ) The entire codebase of HiSock has been refactored! Now, it is much cleaner and easier to understand than the previous release's codebase. Huge shoutout to sheepy0125 again for spending his time on refactoring HiSock.
- ( sheepy0125, SSS-Says-Snek ) Documentation of HiSock has also been massively improved!
- ( SSS-Says-Snek ) Improved cache by switching from dictionaries to instances of `MessageCacheMember`. Now, you can use the dot notation (e.g. `cache.header`) to access a cache member's contents.
- ( SSS-Says-Snek ) Changed client data parameter in functions from dictionaries to instances of `ClientInfo`. Now, you can use dot notation to access a client's info. You can also directly pass this to `.send()` and other related commands, instead of passing the IP attribute.
- ( SSS-Says-Snek ) Not passing any name in `change_name()` and `change_group()` resets the client to its original name.
- ( SSS-Says-Snek, For Contributors) Improved `setup.py` yet again, with new commands, more colors, and more debug information.
- ( sheepy0125, SSS-Says-Snek, For Contributors) Refactored and added tests.

BUG FIXES
- ( SSS-Says-Snek ) Fix numerous threaded client and server bugs.
- ( SSS-Says-Snek ) Fix two group bugs involving name changes.

That's all for this release; it's been a while since we released the latest version, but we hope that HiSock improved with this version. Bye!

1.2

Another version has dropped, this time it's 1.2! Over the past `18` days, we have pushed `51` commits to hisock, modifying `24` files. We also added `849` lines and deleted `430` lines! Now, let's get into the new features of version 1.2!

**NEW**
- Dictionary sending support for `HiSockServer` and `HiSockClient`! Now you can send dictionaries with `.send({"Hi": "Chicken Nugget"})`.
- A message cache, also for `HiSockServer`! It's been a while since we added a message cache for the client, but now it's here for servers!

**IMPROVED**
- Documentation improvements! After all, it can't be a new version without some good improvements to the docs.
- Improved type hints in the codebase. Now, IDEs should provide more accurate code scanning.
- Added an `all_ips` flag for `get_local_ip`. Now, the function will give you all of your local IPs if you set `all_ips` to True!
- Added an `emit_leave` flag for HiSockClient's `close` (thanks sheepy0125 !) Now, if you set the flag to True, the client should close its socket all by itself, without notifying the server that it's going to close.
- Added a `force` flag for HiSockServer's `disconnect_all_clients`. It will now brutally close all the client sockets and clear the client lists and dictionaries if you set the flag to True, ensuring that all clients would be disconnected.
- Improve type casting.
- (For contributors) Improved `setup.py`! Now it looks very cool when building the wheels for hisock.
- (For contributors) Cleaned up the root project. No more `Dockerfile`, yay!
- (For contributors) Added some new tests for type casting.

**BUG FIXES**
- Add support for "bytes -> bytes" type casting. As sheepy0125 pointed out, if a user type hints a function argument to `bytes`, then hisock versions `1.1` and below would reject that. Now, that has been patched.
- Fix two more type casting bugs. Both are STUPID ones.
- Fix a bug regarding clients not disconnecting, but raising a `NoMessageException`.

**OTHER**
- We welcome sheepy0125 with his first code-based contribution to hisock!

That's it for this release of hisock, and I'll see you next time! Bye!

1.1

The first minor version of since Hisock 1.0! Over the course of `48` days, we (I) have pushed `47` commits to hisock, changing `26` files. We (I) have added `992` lines and deleted `647` lines! Originally, this was supposed to be a micro release of `1.0.1`. But, with the additions of some new functions and methods, I've decided to bump this release to a minor version. Without further ado, here are the changelogs of v1.1:

**NEW**
- A message cache for `HiSockClient`! The message cache allows you to view the last **x** messages sent by the client. Configuration of the message cache is available on creation of the instance.
- `.disconnect_client()`, `.disconnect_all_clients()`, and `.close()` methods for `HiSockServer`, as well as the `force_disconnect` reserved function for `HiSockClient`! It's now easier to force disconnect of a client from a server with these functions. The `force_disconnect` reserved function will be triggered when the client has been disconnected from the server with these functions.
- Add `list` and `dict` type casts for `HiSockClient`.

**IMPROVED**
- Documentation improvements, yay!
- Handle hisock errors better (not crashes!). New exceptions have been created for specific causes of server/client errors.
- `cleancode.py` can now clean up the code, with the help of `black`! So, the code has been PEP8-ified, for our (my) avid PEP8 fans.
- Move `HiSockClient` and `HiSockServer` to be available on import of hisock.
- Move `__version__` to be available on import of hisock.
- Separate `requirements.txt` into that and `requirements_contrib.txt`. Some of the requirements are actually just requirements for the tests to run.

**BUG FIXES**
- (Maybe) fix bug for the `.close()` method of `HiSockClient`.
- Fixed a fatal import error of hisock.

**OTHER**
- Hisock now has a new logo, created by sheepy0125!
- Hisock also has a discord server! However, we're (I'm) still setting it up, so the invite isn't public yet.

That's it for this release of `1.1`, and I'll see you next time! Bye!

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.