2009-09-17 15:38 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* contrib/hbnetio/utils/netiosrv.prg
    + Added header.
    + Showing server configuration.
This commit is contained in:
Viktor Szakats
2009-09-17 13:38:32 +00:00
parent 35ec14bff9
commit f8cd3bf329
2 changed files with 42 additions and 10 deletions

View File

@@ -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

View File

@@ -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 <server> <port> <root>" + hb_osNewLine() )
RETURN
STATIC FUNCTION HBRawVersion()
RETURN StrTran( Version(), "Harbour " )