summaryrefslogtreecommitdiff
path: root/devtools/smtpmail/simplesocket.h
blob: 4b9fdb110f2a502d0bc7b8931ff10ea3aa803f75 (plain) (blame)
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
37
38
39
40
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: simple TCP socket API for communicating as a TCP client over a TEXT
//			connection
//
// $Workfile:     $
// $Date:         $
//
//-----------------------------------------------------------------------------
// $Log: $
//
// $NoKeywords: $
//=============================================================================//

#ifndef SIMPLESOCKET_H
#define SIMPLESOCKET_H
#pragma once

// opaque socket type
typedef struct socket_s socket_t, *HSOCKET;

// Socket reporting function
typedef void ( *REPORTFUNCTION )( HSOCKET socket, const char *pString );

extern HSOCKET		SocketOpen( const char *pServerName, int port );
extern void			SocketClose( HSOCKET socket );
extern void			SocketSendString( HSOCKET socket, const char *pString );

// This should probably return the data so we can handle errors and receive data
extern void			SocketWait( HSOCKET socket, const char *pString );

// sets the reporting function
extern void			SocketReport( REPORTFUNCTION pReportFunction );
extern void			SocketInit( void );
extern void			SocketExit( void );




#endif // SIMPLESOCKET_H