From e1a5279767486b4346149fbd5043836a60d1c281 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 7 Sep 2009 19:18:35 +0000 Subject: [PATCH] 2009-09-07 21:16 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + contrib/hbnetio/utils + contrib/hbnetio/utils/netiosrv.prg + contrib/hbnetio/utils/hbmk.hbm + Committed simple server code posted in the ChangeLog entry from Przemek. I've added very simple passing of port and address parameters, this can be enhanced in the future using proper switches. Plus maybe an option to avoid accidental exit by keypress. --- harbour/ChangeLog | 10 +++++++++ harbour/contrib/hbnetio/utils/hbmk.hbm | 6 +++++ harbour/contrib/hbnetio/utils/netiosrv.prg | 26 ++++++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 harbour/contrib/hbnetio/utils/hbmk.hbm create mode 100644 harbour/contrib/hbnetio/utils/netiosrv.prg diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5632062082..29eba307cb 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,16 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-07 21:16 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + + contrib/hbnetio/utils + + contrib/hbnetio/utils/netiosrv.prg + + contrib/hbnetio/utils/hbmk.hbm + + Committed simple server code posted in the ChangeLog entry + from Przemek. I've added very simple passing of port and + address parameters, this can be enhanced in the future + using proper switches. Plus maybe an option to avoid + accidental exit by keypress. + 2009-09-07 18:18 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/hbsocket.c % modified hb_socketResolveAddr() to try use given address in diff --git a/harbour/contrib/hbnetio/utils/hbmk.hbm b/harbour/contrib/hbnetio/utils/hbmk.hbm new file mode 100644 index 0000000000..7b4bfe2bd4 --- /dev/null +++ b/harbour/contrib/hbnetio/utils/hbmk.hbm @@ -0,0 +1,6 @@ +# +# $Id$ +# + +../hbnetio.hbc +-mt diff --git a/harbour/contrib/hbnetio/utils/netiosrv.prg b/harbour/contrib/hbnetio/utils/netiosrv.prg new file mode 100644 index 0000000000..fd7900942c --- /dev/null +++ b/harbour/contrib/hbnetio/utils/netiosrv.prg @@ -0,0 +1,26 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * demonstration/test code for alternative RDD IO API which uses own + * very simple TCP/IP file server. + * + * Copyright 2009 Przemyslaw Czerpak + * www - http://www.harbour-project.org + * + */ + +proc main( cPort, cAddress ) + local pListenSocket + + pListenSocket := netio_mtserver( hb_ntos( cPort ), cAddress ) + if empty( pListenSocket ) + ? "Cannot start server." + else + wait "Press any key to stop NETIO server." + netio_serverstop( pListenSocket ) + pListenSocket := NIL + endif +return