FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Tsocket on local computer via remote desktop
Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Tsocket on local computer via remote desktop
Posted: Wed Mar 27, 2013 03:12 PM

Hello,

I have an application running on a remote server and have a customer accessing application via remote desktop. I have a printer (Intermec PD41 - connected via ethernet with assigned IP address) connected to customer's local workstation and I need to use SENDDATA (listed below) function to send printer code (Intermec Fingerprint) to printer.

Is it possible to send data to local workstation's IP address via remore desktop? If so, can someone provide an example?

Sincerely,

//-----------------------------------------------------------------------------
FUNCTION SENDDATA( nPort, cIP, cMsg )

LOCAL oSocket := TSocket():New( nPort )

oSocket:bConnect := { || oSocket:SendData( "MSG " + cMsg ),;
oSocket:End() }

oSocket:Connect( cIP )

RETURN NIL

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 174
Joined: Sat Feb 23, 2013 10:04 AM
Re: Tsocket on local computer via remote desktop
Posted: Wed Mar 27, 2013 03:45 PM

hi,

have you tried netio harbour component ?

Regards

Posts: 708
Joined: Fri Oct 28, 2005 09:53 AM
Re: Tsocket on local computer via remote desktop
Posted: Wed Mar 27, 2013 03:48 PM

Hi Antonio,

Thank you for your response. No, do you have an example? I will look for netio documentation.

*~*~*~*~*~*~*~*~*~*
Darrell Ortiz
CDM Software Solutions, Inc.
https://www.cdmsoft.com
Posts: 174
Joined: Sat Feb 23, 2013 10:04 AM
Re: Tsocket on local computer via remote desktop
Posted: Wed Mar 27, 2013 04:30 PM

I don´t know it works NETIO, but by reading the code .prg, I think it is a powerful component

About hbNetIO:

Massimo's blog is outdated (http://harbourlanguage.blogspot.com.es/ ... netio.html).
Giovanni's harbour documentation does not includes hbNetIO.

Only, it seems, there is documentation in the 1) changelog, scattered and incomplete, and also 2) the list of users and development and in 3) the source code of Harbour ;-)

regards

Posts: 174
Joined: Sat Feb 23, 2013 10:04 AM
Re: Tsocket on local computer via remote desktop
Posted: Wed Mar 27, 2013 07:40 PM
Darrell,

A hbNetIO test:

Code (fw): Select all Collapse
//////////////////
// TestCli.Prg        -- Program client (this file)--
//
//
// Notes:
//
//    \hb32                 is harbour dir  
//    \hb32\bin\hbNetIO.Exe is server NetIO
//    c:\data               is dir data. It must contains Test.Dbf
//
//
// Testing hbNetIO Server from harbour. Steps:
//
//   1st) Mk c:\data
//   2nd) In \hb32\bin run hbnetio so: hbnetio -rootdir=c:\data
//   3rd) Compile, build, run and fun testcli.prg
//
////////////////////////////////////////////////////////////////////////
//-------------------------------------------------------------------------//
FUNCTION Main()
Local oerr
#define DBSERVER  "127.0.0.1"
#define DBPORT    2941
#define DBDIR     "Data"
#define DBFILE    "Test"
#define DBNAME    "net:"+ DBFILE

request DBFCDX, DBFFPT

set exclusive off
rddsetdefault("DBFCDX")

netio_connect( DBSERVER, hb_ntos(DBPORT))
try
   use (DBNAME)
   ? "conexion ok !", fieldname(1), fieldget(1)
catch oerr
   ? "conexion error", oerr:description+ CRLF+ oErr:operation+ CRLF+ oErr:FileName
end

return

Continue the discussion