Files
harbour-core/harbour/contrib/hbmisc/tests/udpdstst.prg
Viktor Szakats 4a22ee33f7 2010-11-26 13:44 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* include/hbapi.h
  * src/common/hbver.c
    + Added hb_iswin2k3().

  * src/rtl/hbsocket.c
    + Comment.
    ; TOFIX: Use SO_EXCLUSIVEADDRUSE on Windows.
             See: http://paste.lisp.org/display/59751

  - examples/udpds
  + contrib/hbmisc/tests/udpdstst.prg
  + contrib/hbmisc/udpds.prg
  * contrib/hbmisc/hbmisc.hbp
    + Moved UDPDS functions to hbmisc lib. Added hb_ prefix to names,
      plus formatted with hbformat.

  * contrib/hbhttpd/tests/webapp.prg
    * Formatting.

  ; Patch from Tamas:

  * config/bsd/gcc.mk
  * config/bsd/clang.mk
    * switch bsd to -fPIC, otherwise not even core builds (on 8.1/amd64)
    * while there, bring bsd/gcc.mk in line with linux/gcc.mk (now they
      are identical)
    * ditto for bsd/clang.mk

  * contrib/hbqt/hbqt_common.hbc
    * for hbqt, switch static supc++ to dynamic stdc++, otherwise dyn hbqt
      doesn't build. this is because on at least fbsd supc++ is apparently
      not pic; but switching from static supc++ to dynamic stdc++ easily
      fixes it.
2010-11-26 12:46:14 +00:00

43 lines
792 B
Plaintext

/*
* $Id$
*/
/*
* This module demonstrates a simple UDP Discovery Server
*/
PROCEDURE main( cParam )
LOCAL h
IF ! hb_MTVM()
? "This sample should be compiled using MultiThread"
RETURN
ENDIF
IF cParam == NIL
? "udpdstst {c|s|cs}"
? "Parameter:"
? " s - run as a server"
? " c - run as a client"
RETURN
ENDIF
IF "S" $ Upper( cParam )
IF ! Empty( h := hb_UDPDS_Start( 39999, "UDPDSDemo", NetName() + " " + hb_TSToStr( hb_DateTime() ) ) )
hb_idleSleep( 0.1 )
ENDIF
ENDIF
IF "C" $ Upper( cParam )
? HB_VALTOEXP( hb_UDPDS_Find( 39999, "UDPDSDemo" ) )
ENDIF
IF "S" $ Upper( cParam )
? "Press any key to stop server"
Inkey( 0 )
hb_UDPDS_Stop( h )
ENDIF
RETURN