Tsocket on local computer via remote desktop

Tsocket on local computer via remote desktop

Postby cdmmaui » Wed Mar 27, 2013 3: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
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Tsocket on local computer via remote desktop

Postby Antonio Mart. » Wed Mar 27, 2013 3:45 pm

hi,

have you tried netio harbour component ?

Regards
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

Re: Tsocket on local computer via remote desktop

Postby cdmmaui » Wed Mar 27, 2013 3: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
User avatar
cdmmaui
 
Posts: 689
Joined: Fri Oct 28, 2005 9:53 am
Location: Houston ∙ Chicago ∙ Los Angeles ∙ Miami ∙ London ∙ Hong Kong

Re: Tsocket on local computer via remote desktop

Postby Antonio Mart. » Wed Mar 27, 2013 4: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
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am

Re: Tsocket on local computer via remote desktop

Postby Antonio Mart. » Wed Mar 27, 2013 7:40 pm

Darrell,

A hbNetIO test:

Code: Select all  Expand view
//////////////////
// 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
 
Antonio Mart.
 
Posts: 174
Joined: Sat Feb 23, 2013 10:04 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 95 guests