From f8cd3bf329fd45fc29dd0cc8e77f27d1323e572b Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 17 Sep 2009 13:38:32 +0000 Subject: [PATCH] 2009-09-17 15:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbnetio/utils/netiosrv.prg + Added header. + Showing server configuration. --- harbour/ChangeLog | 5 +++ harbour/contrib/hbnetio/utils/netiosrv.prg | 47 +++++++++++++++++----- 2 files changed, 42 insertions(+), 10 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8b2cc3c7e6..7cc91f49ba 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-09-17 15:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbnetio/utils/netiosrv.prg + + Added header. + + Showing server configuration. + 2009-09-17 15:13 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * utils/hbmk2/hbmk2.prg - Deleted supc++ lib. hbmk2 won't be able to solve every existing diff --git a/harbour/contrib/hbnetio/utils/netiosrv.prg b/harbour/contrib/hbnetio/utils/netiosrv.prg index 42f12a8e7d..331f4de205 100644 --- a/harbour/contrib/hbnetio/utils/netiosrv.prg +++ b/harbour/contrib/hbnetio/utils/netiosrv.prg @@ -13,17 +13,44 @@ */ /* netio_mtserver() needs MT HVM version */ -request HB_MT +REQUEST HB_MT -proc main( port, ifaddr, root ) - local pListenSocket +PROCEDURE Main( port, ifaddr, root ) + LOCAL pListenSocket + + HB_Logo() + + pListenSocket := netio_mtserver( iif( port != NIL, Val( port ), ), ifaddr, root ) + IF Empty( pListenSocket ) + OutStd( "Cannot start server." + hb_osNewLine() ) + ELSE + OutStd( "Listening on: " + iif( ifaddr != NIL, ifaddr, "127.0.0.1" ) + ":" + iif( port != NIL, port, "2941" ) + hb_osNewLine() ) + OutStd( "Root filesystem: " + iif( root != NIL, root, hb_dirBase() ) + hb_osNewLine() ) + + OutStd( hb_osNewLine() ) + OutStd( "Press any key to stop NETIO server." + hb_osNewLine() ) + Inkey( 0 ) - pListenSocket := netio_mtserver( iif( port != NIL, val( port ), ), ifaddr, root ) - if empty( pListenSocket ) - ? "Cannot start server." - else - wait "Press any key to stop NETIO server." netio_serverstop( pListenSocket ) pListenSocket := NIL - endif -return + ENDIF + + RETURN + +STATIC PROCEDURE HB_Logo() + + OutStd( 'Harbour NETIO Server ' + HBRawVersion() + hb_osNewLine() +; + "Copyright (c) 2009, Przemyslaw Czerpak" + hb_osNewLine() + ; + "http://www.harbour-project.org/" + hb_osNewLine() +; + hb_osNewLine() ) + + RETURN + +STATIC PROCEDURE HB_Usage() + + OutStd( "Syntax: netiosrv " + hb_osNewLine() ) + + RETURN + +STATIC FUNCTION HBRawVersion() + RETURN StrTran( Version(), "Harbour " )