| 1 |
#ifndef EASYNET_H |
| 2 |
#define EASYNET_H |
| 3 |
|
| 4 |
#include <MacTypes.h> |
| 5 |
|
| 6 |
#define kEasyNetCRLF "\015\012" |
| 7 |
|
| 8 |
enum { |
| 9 |
kEasyNetTimeoutErr = -30200, |
| 10 |
kEasyNetConnectFailedErr = -30201, |
| 11 |
kEasyNetDisconnectedErr = -30202 |
| 12 |
}; |
| 13 |
|
| 14 |
typedef struct EasyNetConn EasyNetConn; |
| 15 |
|
| 16 |
OSStatus EasyNet_Init(void); |
| 17 |
void EasyNet_Shutdown(void); |
| 18 |
|
| 19 |
OSStatus EasyNet_Connect(const char *host, UInt16 port, long timeoutSecs, EasyNetConn **outConn); |
| 20 |
|
| 21 |
OSStatus EasyNet_Send(EasyNetConn *conn, const void *data, long length); |
| 22 |
OSStatus EasyNet_SendString(EasyNetConn *conn, const char *s); |
| 23 |
long EasyNet_Receive(EasyNetConn *conn, void *buf, long size); |
| 24 |
void EasyNet_Close(EasyNetConn *conn); |
| 25 |
|
| 26 |
#endif |