-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/raspi/jumiks
- Loading branch information
Showing
1 changed file
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
# jumiks | ||
|
||
Local AF_UNIX unix socket domain server and client for sending | ||
messages from one server to multiple clients. | ||
Local `AF_UNIX` [unix domain socket](https://en.wikipedia.org/wiki/Unix_domain_socket) server and client which uses TCP-style `SOCK_SEQPACKET` (`unixpacket` in Go) packets for sending messages from one server to multiple clients. | ||
|
||
See [example](example) directory for example. | ||
|
||
## Protocol | ||
|
||
The maximum unix domain socket packet size is determined with kernel parameters. | ||
Server counts packets from the client and user can set a limit to the server. If client gets too far behind the server disconnects that client. This is so that memory can be freed. | ||
|
||
### Handshake | ||
|
||
When a client connects the server sends version information. Client replies with it's version information. If the version is correct the connection is added to the server's connection list, otherwise the connection is closed. | ||
|
||
### Packets | ||
|
||
After the handshake the server simply sends what ever bytes it wants to the client. | ||
|
||
The packet first contains the packet ID (uint64) and then the actual data from end-user. Client replies with packet ID after it has handled the packet. | ||
|