/* --------------------------------------------------------------------------------
 #
 #	SocketPlugin.h
 #	source generated by 4D Plugin Wizard
 #	Project : MA TCP Plugin
 #	author : pasi
 #	5.1.2008
 #
 # --------------------------------------------------------------------------------*/
// http://www.unixguide.net/network/socketfaq/

#ifndef TcpPluginHPP
#define TcpPluginHPP

#include "Includes.h"

// private helper:
void ReceiveBlob( PA_PluginParameters params, int isLookaheadCall );


long MA_SocketPluginMain( long selector, PA_PluginParameters params );
void InitTcp();
void DeInitTcp();

void MA_apr_initialize();
void MA_apr_terminate();

static wstring errTxtSocket; // last error text
wstring aprErrorNumToText( apr_status_t err );
  
void MA_TCP_SQLReinitialize( PA_PluginParameters params );
void MA_TCP_GetVersion( PA_PluginParameters params );
void MA_TCP_GetLastErrorText( PA_PluginParameters params );


// --- MA_Socket General Commands
void MA_GetHostName( PA_PluginParameters params );
void MA_GetHostByName( PA_PluginParameters params );
void MA_GetHostByAddress( PA_PluginParameters params );
void MA_GetLocalAddresses( PA_PluginParameters params );

// --- TCP Commands
void MA_TCP_Connect( PA_PluginParameters params );
void MA_TCP_Close( PA_PluginParameters params );
void MA_TCP_Listen( PA_PluginParameters params );
void MA_TCP_Accept( PA_PluginParameters params );
void MA_TCP_SendBlob( PA_PluginParameters params );
void MA_TCP_ReceiveBlob( PA_PluginParameters params );
void MA_TCP_LookaheadBlob( PA_PluginParameters params );
void MA_TCP_GetLocalAddress( PA_PluginParameters params );
void MA_TCP_GetRemoteAddress( PA_PluginParameters params );
void MA_TCP_GetOSSocket( PA_PluginParameters params );
void MA_TCP_GetState( PA_PluginParameters params );


void MA_TCP_SetPollArrays( PA_PluginParameters params );
void MA_TCP_CreatePollset( PA_PluginParameters params );
void MA_TCP_DestroyPollset( PA_PluginParameters params );
void MA_TCP_Poll( PA_PluginParameters params );
void MA_TCP_GetPollCounts( PA_PluginParameters params );

/*
void MA_TCP_Send( PA_PluginParameters params );
void MA_TCP_Receive( PA_PluginParameters params );
void MA_TCP_Lookahead( PA_PluginParameters params );
void MA_TCP_Get_SSL_Verify_Result( PA_PluginParameters params );
void MA_TCP_Is_Secure_Connection( PA_PluginParameters params );

// --- UDP Commands
void MA_UDP_Open( PA_PluginParameters params );
void MA_UDP_Listen( PA_PluginParameters params );
void MA_UDP_Close( PA_PluginParameters params );
void MA_UDP_Send( PA_PluginParameters params );
void MA_UDP_Send_Blob( PA_PluginParameters params );
void MA_UDP_Receive( PA_PluginParameters params );
void MA_UDP_Receive_Blob( PA_PluginParameters params );
void MA_UDP_Join_Group( PA_PluginParameters params );
void MA_UDP_Leave_Group( PA_PluginParameters params );
void MA_UDP_Set_Max_Router_Hops( PA_PluginParameters params );
void MA_UDP_Send_To_Self( PA_PluginParameters params );

// --- IPC Commands
void MA_IPC_New_Channel( PA_PluginParameters params );
void MA_IPC_Delete_Channel( PA_PluginParameters params );
void MA_IPC_Get_Channel_Name( PA_PluginParameters params );
void MA_IPC_Send( PA_PluginParameters params );
void MA_IPC_Broadcast( PA_PluginParameters params );
void MA_IPC_Receive( PA_PluginParameters params );
void MA_IPC_Count_Messages( PA_PluginParameters params );
void MA_IPC_Get_Message_By_Index( PA_PluginParameters params );
void MA_IPC_Count_Channels( PA_PluginParameters params );
void MA_IPC_Get_Channel_By_Index( PA_PluginParameters params );
void MA_IPC_Get_Channel_By_Name( PA_PluginParameters params );
*/

#endif // TcpHPP