aboutsummaryrefslogtreecommitdiff
path: root/protocol.h
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2023-09-20 23:24:05 -0400
committersotech117 <michael_foiani@brown.edu>2023-09-20 23:24:05 -0400
commit3d9c7d4c5ae135ace068ba50f6b3ae971d8e276b (patch)
tree5e391492380af5fb351d543d8fd6b17ad5871afe /protocol.h
parent362250d1cb923d9ced8ea51508ace50b76050b06 (diff)
implement collecting all bits, if they don't come in one message
Diffstat (limited to 'protocol.h')
-rw-r--r--protocol.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/protocol.h b/protocol.h
index 39f26e6..aeeaa54 100644
--- a/protocol.h
+++ b/protocol.h
@@ -25,8 +25,7 @@ struct Welcome {
struct Reply {
uint8_t replyType;
uint8_t stringSize;
- char *string;
-} __attribute__((packed));
+} reply_t __attribute__((packed));
struct Announce {
uint8_t replyType;
uint8_t songnameSize;
@@ -36,4 +35,7 @@ struct InvalidCommand {
uint8_t replyType;
uint8_t replyStringSize;
char *replyString;
-} __attribute__((packed)); \ No newline at end of file
+} __attribute__((packed));
+
+int send_all(int sock, char *buf, int *len);
+int recv_all(int sock, char *buf, int *len);