Files
harbour-core/tests/ipclnt.prg
vszakats 9687850865 2013-03-16 02:10 UTC+0100 Viktor Szakats (harbour syenar.net)
* (all files)
    * stripped svn header
    * minor cleanups
    ; use following command to find out the history of files:
       git log
       git log --follow
       git blame
       git annotate
2013-03-16 02:11:42 +01:00

28 lines
718 B
Plaintext

#include "hbsocket.ch"
#define ADDRESS "127.0.0.1"
#define PORT 10000
#define EOT hb_BChar( 4 )
PROCEDURE Main()
LOCAL hSocket
IF Empty( hSocket := hb_socketOpen() )
? "socket create error " + hb_ntos( hb_socketGetError() )
ENDIF
IF ! hb_socketConnect( hSocket, { HB_SOCKET_AF_INET, ADDRESS, PORT } )
? "socket connect error " + hb_ntos( hb_socketGetError() )
ENDIF
? hb_socketSend( hSocket, "hi" + EOT )
? hb_socketSend( hSocket, "how" + EOT )
? hb_socketSend( hSocket, "you doing?" + EOT )
? hb_socketSend( hSocket, "quit" + EOT )
hb_socketShutdown( hSocket )
hb_socketClose( hSocket )
RETURN