Skip to content

Conversation

@pizhenwei
Copy link
Contributor

@pizhenwei pizhenwei commented Jul 16, 2024

  • Move valkeyContextDefaultFuncs into net.c, then valkeyNetRead & valkeyNetWrite could be declared as static functions. async.h is no longer needed by valkey.c, that makes valkey.c independent from networking IO specific operations.
  • Add .connect for valkeyContextFuncs, allow none-socket transport. Remove connection type related functions from valkey.c

@pizhenwei pizhenwei changed the title Hide valkeyNetRead & valkeyNetWrite Fully abstract valkeyContextFuncs Jul 18, 2024
@pizhenwei
Copy link
Contributor Author

Hi @michael-grunder
Would you please take a look at this PR?

- Hide valkeyNetRead & valkeyNetWrite
Move valkeyContextDefaultFuncs into net.c, then valkeyNetRead &
valkeyNetWrite could be declared as static functions.
async.h is no longer needed by valkey.c, that makes valkey.c
independent from networking IO specific operations.

- Introduce .connect for valkeyContextFuncs

Abstract .connect method, then new connection type has a chance to
implement its own connect function. Finally, TCP/Unix/Userfd related
functions have been removed from valkey.c.

- Introduce .set_timeout method, setsockopt is only available for
socket family. None-socket transport would fail on this. .set_timeout
allows transport specific timeout setting function.

Signed-off-by: zhenwei pi <[email protected]>
If necessary private context gets freed first, NULL pointer would be
accessed in .close method. The right and safe timing should be
.close then .free_privctx.

Signed-off-by: zhenwei pi <[email protected]>
@pizhenwei
Copy link
Contributor Author

#55 contains this part, so close this PR.

@pizhenwei pizhenwei closed this Jul 23, 2024
@pizhenwei pizhenwei deleted the hide-net-io branch August 1, 2024 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant