18 lines
529 B
C
18 lines
529 B
C
#ifndef TRANSPORT_H
|
|
#define TRANSPORT_H
|
|
|
|
#include <winsock2.h> // For SOCKET
|
|
|
|
// Transport abstraction
|
|
typedef struct {
|
|
void* handle; // Opaque pointer to underlying connection (WOLFSSL* or SOCKET)
|
|
int (*send) (void* handle, const char* data, size_t len);
|
|
int (*recv) (void* handle, char* buffer, size_t len);
|
|
void (*cleanup) (void* handle);
|
|
} Transport;
|
|
|
|
Transport* InitTransport(const char* domain, unsigned short port);
|
|
void CleanupTransport(Transport* transport);
|
|
char* GetNextDomain();
|
|
|
|
#endif // TRANSPORT_H
|