forked from bearycool11/PMLL_logic_loop_Knowledge_block
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAPI_Llama.h
36 lines (28 loc) · 876 Bytes
/
API_Llama.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef API_H
#define API_H
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
// Constants
#define API_URL "localhost"
#define API_PORT 8080
#define CROSS_TALK_URL "localhost"
#define CROSS_TALK_PORT 8081
#define PMLL_URL "localhost"
#define PMLL_PORT 8082
#define ARLL_URL "localhost"
#define ARLL_PORT 8083
#define EFLL_URL "localhost"
#define EFLL_PORT 8084
#define BUFFER_SIZE 1024
// Function Prototypes
// Socket management
int create_socket();
void set_up_server_address(struct sockaddr_in* server_addr, const char* url, int port);
void connect_to_server(int sockfd, struct sockaddr_in* server_addr);
// Request and response handling
void send_request(int sockfd, const char* request);
void receive_response(int sockfd, char* response);
// Logic loop cascading
void run_logic_loop_cascade(int sockfd, const char* request);
#endif // API_Ho