Initial Commit:
- Create single library for all Core RedA functions/classes - Working version
This commit is contained in:
42
SocketCore.h
Normal file
42
SocketCore.h
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* SocketCore.h
|
||||
*
|
||||
* Created on: 13 May 2016
|
||||
* Author: wentzelc
|
||||
*/
|
||||
|
||||
#ifndef SOCKETCORE_H_
|
||||
#define SOCKETCORE_H_
|
||||
|
||||
// redA Libraries
|
||||
/* none */
|
||||
|
||||
// Standard C/C++ Libraries
|
||||
/* none */
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// Types required for sockets
|
||||
typedef enum { ctNone = 0, ctServer = 1, ctRemoteClient = 2, ctClient = 3 } ESockConnectType;
|
||||
const char SockConnectTypeName[][15] = { "None", "Server", "RemoteClient", "Client" };
|
||||
|
||||
typedef enum { ssNone = 0, ssWaitingtoOpen = 1, ssOpen = 2, ssDataWaiting = 3, ssClosed = 4, ssFailed = 5 } ESocketState;
|
||||
const char SocketStateName[][15] = { "None", "WaitingToOpen", "Open", "DataWaiting", "Closed", "Failed" };
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
// Socket Functions
|
||||
int OpenTCPserverSocket( const char *pServerName, const char *ServerAddress, int PortNo, bool KeepAlive );
|
||||
int OpenTCPinClientSocket();
|
||||
int OpenTCPoutClientSocket( const char *pServerName, const char *ServerAddress, int PortNo, bool KeepAlive );
|
||||
|
||||
ESocketState GetServerState();
|
||||
ESocketState GetClientState();
|
||||
|
||||
bool CloseTCPSocket( ESockConnectType SocketType );
|
||||
|
||||
bool ReadClientSocket();
|
||||
bool MaintainSocket( int PortHandle );
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#endif /* SOCKETCORE_H_ */
|
||||
Reference in New Issue
Block a user