about summary refs log tree commit diff
AgeCommit message (Collapse)Author
2025-05-27Fix broadcasting HEAD v1.0.2 masterNakidai
When iterating through receivers code was assuming that ppeers[n].fd == peers[n] that is wrong. Noticed in #1 by @aureliumsk: https://github.com/nakidai/ttb/issues/1
2025-05-11Add check for EINTR on braoadcast writingNakidai
When signal occures, write can return with EINTR and shouls be recalled then see: signal(7)
2025-05-11Simplify sendingNakidai
Since with tcp socket write call will either send whole buffer of return an error (no probability of partial send) complex sending loop can be removed and replaced with one write call instead see: send(2), write(2), signal(7)
2025-05-08Fix bug in writeNakidai
On each iteration of partial write ttb need to shift data it want to send rather than try to resend whole buffer again
2025-05-08Improve styleNakidai
It was a bit inconsistent then
2025-04-27Fix server socketNakidai
Since it is used in poll, no need for it to be non-blocking Also, accept(2) actually has a lot of error codes, and its return value should be checked
2025-04-26Fix ppeers generatingNakidai
While generating, server socket must be added so it will be able to be poll(2)ed
2025-04-26Optimize variablesNakidai
- There's no need for storing port and inaddr as separated variables - res can be declared in line with peers - Also, since POLL_WAITMS was removed, no need for checking poll for 0
2025-04-26Move sock to peersNakidai
This way it's also handled through poll, so no need for POLL_WAITMS anymore Though peers[0] is now reserved for server's socket, so server can handle up to SOCKETS_MAX-1 sockets from now
2025-04-17Some improvements v1.0.1Nakidai
- Don't make client sockets nonblocking as poll doesnt require this. Hence, fcntl and errno are not needed there anymore - Add ; after label cuz clang complains about variable declarations after labels and blah blah - Add checks for write(2) call to be sure that all data is sent
2025-04-17Add files v1.0.0Nakidai