Commit Graph

4 Commits

Author SHA1 Message Date
Andreas Kling
b3fe9cde52 LibCore: Add CLocalServer, a server-only local socket class.
Instead of trying to support both client and server in CLocalSocket, let's
have a specialized server class.

The basic usage is:

    CLocalServer server;
    server.listen("/tmp/name-of-portal");
    server.on_ready_to_accept = [&] {
        CLocalSocket* client = server.accept();
        ...
    };

This will make things a lot simpler, since an accepting socket doesn't need
half of the stuff that a regular CIODevice provides. :^)
2019-07-27 10:32:40 +02:00
Andreas Kling
be2b585ca6 LibCore: Add CSocket::bind() (virtual) and CSocket::listen().
These will be useful for implementing server sockets.
2019-07-26 22:39:16 +02:00
Robin Burchell
a714fc661d LibCore: Add a way to mark a socket as blocking (or not)
If custom I/O is being done outside CIODevice, we need a way to force blocking sometimes.
This also fixes the default of CLocalSocket to be non-blocking, the same
as CTCPSocket.
2019-07-16 20:22:54 +02:00
Robin Burchell
ffa8cb668f AudioServer: Assorted infrastructure work
* Add a LibAudio, and move WAV file parsing there (via AWavFile and AWavLoader)
* Add CLocalSocket, and CSocket::connect() variant for local address types.
  We make some small use of this in WindowServer (as that's where we
  modelled it from), but don't get too invasive as this PR is already
  quite large, and the WS I/O is a bit carefully done
* Add an AClientConnection which will eventually be used to talk to
  AudioServer (and make use of it in Piano, though right now it really
  doesn't do anything except connect, using our new CLocalSocket...)
2019-07-13 22:57:24 +02:00