anzhdanov / split-stream-gnunet

Automatically exported from code.google.com/p/split-stream-gnunet
0 stars 0 forks source link

ClientList and client notification #4

Open anzhdanov opened 9 years ago

anzhdanov commented 9 years ago

struct ClientList { struct GNUNET_SERVER_Client* client; struct ClientList* prev; struct ClientList* next; }; Why do you need such a 'struct ClientList' when you already have 'struct Client' below? This seems like a duplication. Also, if you just want to send a message to all members of a group of subscribed clients (see struct Group below), you can just create a GNUNET_SERVER_NotificationContext and add the clients to it. It'll even manage client disconnects for you (and also allows you to unicast to individual clients in addition to broadcasting to 'all' clients).

anzhdanov commented 9 years ago

//a list of clients struct ClientList* cl_head; struct ClientList* cl_tail; See above: instead of having your one "global" nc, you should create one per group! That way, you can probably eliminate most group membership operations you have here.

anzhdanov commented 9 years ago

struct Client { //a list of groups You should say explicitly that these are the groups this client is subscribed to. Can there really be more than one? Does your client-API even allow this? Or can we get rid of the DLL? struct GroupList* gl_head; struct GroupList* gl_tail; /**

  • Public key of the client _/ struct GNUNET_CRYPTO_EddsaPublicKey pubkey; /*
  • Hash of the public key _/ struct GNUNET_HashCode pub_keyhash; /*
  • Private key of the client */ struct GNUNET_CRYPTO_EddsaPrivateKey priv_key; };