1. RE: Telnet friendly App
- Posted by acran at readout.fsnet.co.uk Sep 01, 2002
- 447 views
Hello Nick, Just off the top of my head... I gather that your handheld devices can telnet to the ATAMAN telnet server and run a DOS Euphoria based service without a problem. Your issue is that from DOS you can't get access to certain DLL functions because DLL's can only be accessed from Windows Euphoria. But Windows Euphoria doesn't work as a service with the ATAMAN telnet server. How about having you DOS Euphoria program call a separate Windows Euphoria program to perform the DLL stuff? You will have to come up with a way to pass parameters from the DOS Euphoria code to the Windows Euphoria code. Also if you want results back you'll have to come up with something for that as well. Putting the information into temporary "in" and "out" type files might be one way although I know that is a kludge. But if it works then who cares? Just an idea. Regards, Andy Cranston. At 15:55 01/09/02 +0000, you wrote: > >Mario, > >Thanks for the response. Here is a little background on what I am trying >to do. I have an existing customer base with industrial handheld radio >(802.11) devices that have a telnet client in them. > >I have a variety of data collection applications that I need to write in >support of the these handhelds. These apps need to run in a telnet >session. > >For testing I am using an ATAMAN telnet server that runs on Windows. > >If I create a Euphoria application for DOS (.ex) I can telnet to it and >it runs. For testing I telnet to myself at 127.0.0.1. > >If I create the application as a Windows application (.exw) it does not >run when I telnet to it. > >I need to be able to use some of the features that are only available in >Windows such as SQL routines and calling an external DLL. > >I did purchase the Euphoria interpreter and LCC compiler and tried the >compiled version with no luck. > >My goal is to write applications that the core of which will run under >DOS, Windows and Linux and only change the database or externally called >app (DLL) to match the OS. > >Hope this helps. > >Nick > > >Mario Steele wrote: >> Hey Nick, >> >> Nick Price wrote: >> > I am trying to create an application that I can telnet to that also >> > calls an external DLL. >> > >> > If I create a DOS app telnet works, external DLLs don't. If I create a >> > WIN app external DLLs work but I can't run the app in a telnet session. >> > >> > Any ideas ? >> >> I'm not exactly sure what you are trying to do exactly, if your trying >> to execute Programs from Telnet, and DLL Files, or trying to run DLL >> Files from DOS? If you can clear this up a bit, i'll be willing to help >> >> ya out. >> >> --( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^(@)--|--(@)^ .^(@)-- >> >> >> EuMario >> Mario Steele >> Euphoria Instant Messenger (Soon to Come!) >> http://groups.yahoo.com/group/euim/ >> >> > > >
2. RE: Telnet friendly App
- Posted by Nick Price <nickpriceis at hotmail.com> Sep 01, 2002
- 447 views
Mario and Andy At first glance this looks like a great approach. I’ll play around with this and post the results. There are several issues I need to test for this to work prime time. I may have 50 handhelds hammering away at my app and they need fast response so the response time to do the system_exec has to be fast. Also if the user kills the session I can’t leave any temporary files around. Thanks again. Nick. Mario Steele wrote: > Hey Again Nicky, > > After writting my last post, I got to thinking, and I happen to remember > > a short cut like way to solve this problem, but would involve writting a > > Euphoria Program inside a Euphoria Program. What you could do, is > create a Specialized Temporary File, in which you can write data in, > with the EXW File. And to solve the problem of the STDOUT with EXW > files, you can write yourself a Front End EX file, that will execute the > > EXW File, then when it finishes, you can read the File, grab the data in > > the file, and print it back out to the screen. > > To do this trick, I'll give you a small Example: > (Note, that I don't actually know how SQL Works, or the wrapper, > this is just for Example) > > -- Win32 Application > include sql.ew > > sequence myData > > SQL_open("mydatabase.sql") > myData = SQL_getField("myCustomer") > SQL_close() > > integer fh > fh = open("temp.dat","wb") > puts(fh,myData) > close(fh) > > -- DOS Program > integer myWait, fh > sequence myData > > myWait = system_exec("exw w32app.exw",2) -- system_exec() will wait for > a Return Code, DOS, or Win32 Program. > fh = open("temp.dat","rb") > myData = gets(fh) > close(fh) > puts(1,myData) > > That's all there is to it. This should work, and allow you to Access > DLL Files, to get data from it, temporarly put the data into a Simple > Text File, and get it back out, and printing it to the screen where the > Telnet Daemon can catch it, and post it to your Telnet Screen. > > Let me know if this works. > > > --( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at > )--|--( at )^.^( at )--|--( at )^.^(@)-- > > > EuMario > Mario Steele > Euphoria Instant Messenger (Soon to Come!) > http://groups.yahoo.com/group/euim/ > >
3. RE: Telnet friendly App
- Posted by Mario Steele <euphmario at yahoo.com> Sep 01, 2002
- 423 views
Hey Nicky, One great thing about Euphoria, is that you can delete Files to. And if your worried about Multiple users accessing the same file, you can allways use the date() function, and create a File Name out of it. Example sequence file, Entry Entry = date() file = sprintf("%0.2d-%0.2d-%0.2d--%0.2d-%0.2d-%0.2d.dat", {Entry[2],Entry[3],Entry[1]+1900, Entry[4],Entry[5],Entry[6]} Which, if they accessed it at 01/14/03, at 1:29:35 PM, the File name would come up to be like: 01-14-2003--13-29-35.dat Then you can just do a system("del " & file & " > NUL",2) And if you want to see if the file exists, you can allways do function exist() integer fh fh = open(file,"rb") if fh = -1 then return 0 else close(fh) return 1 end if end function Which returns True if the file exists, or False if it doesn't. If it does, simply run the previous code above for making a filename. It shouldn't take more then a second for Euphoria for Win32 to acomplish it's task, but you also must give time for extensive database searching, if you use SQL. Other then that, recursive name changes, according to time, and date, will run pretty fast, and give less room for two instances of your program to write to the same file. To figure out how long it would actually take for a EXW, and SQL to act, and complete, you can call time() before you call the system_exec(), and assign the value to a Atom, then call time() afterwards, and have Euphoria calculate the Runtime from when it was called, to when it was finished. Just some tips to help ya out. --( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^(@)-- EuMario Mario Steele Euphoria Instant Messenger (Soon to Come!) http://groups.yahoo.com/group/euim/
4. RE: Telnet friendly App
- Posted by thinkways at YAHOO.COM Sep 06, 2002
- 414 views
have you looked at hawke's euserv in the archives? --- Mario Steele <euphmario at yahoo.com> wrote: > > Hey Nick, > > Nick Price wrote: > > I am trying to create an application that I can > telnet to that also > > calls an external DLL. > > > > If I create a DOS app telnet works, external DLLs > don't. If I create a > > WIN app external DLLs work but I can't run the app > in a telnet session. > > > > Any ideas ? > > I'm not exactly sure what you are trying to do > exactly, if your trying > to execute Programs from Telnet, and DLL Files, or > trying to run DLL > Files from DOS? If you can clear this up a bit, > i'll be willing to help > ya out. > > --( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^(@)-- > > EuMario > Mario Steele > Euphoria Instant Messenger (Soon to Come!) > http://groups.yahoo.com/group/euim/ > > > > > >
5. RE: Telnet friendly App
- Posted by Mario Steele <euphmario at yahoo.com> Sep 01, 2002
- 405 views
Hey Nick, Nick Price wrote: > I am trying to create an application that I can telnet to that also > calls an external DLL. > > If I create a DOS app telnet works, external DLLs don't. If I create a > WIN app external DLLs work but I can't run the app in a telnet session. > > Any ideas ? I'm not exactly sure what you are trying to do exactly, if your trying to execute Programs from Telnet, and DLL Files, or trying to run DLL Files from DOS? If you can clear this up a bit, i'll be willing to help ya out. --( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^(@)-- EuMario Mario Steele Euphoria Instant Messenger (Soon to Come!) http://groups.yahoo.com/group/euim/
6. RE: Telnet friendly App
- Posted by Nick Price <nickpriceis at hotmail.com> Sep 01, 2002
- 417 views
Mario, Thanks for the response. Here is a little background on what I am trying to do. I have an existing customer base with industrial handheld radio (802.11) devices that have a telnet client in them. I have a variety of data collection applications that I need to write in support of the these handhelds. These apps need to run in a telnet session. For testing I am using an ATAMAN telnet server that runs on Windows. If I create a Euphoria application for DOS (.ex) I can telnet to it and it runs. For testing I telnet to myself at 127.0.0.1. If I create the application as a Windows application (.exw) it does not run when I telnet to it. I need to be able to use some of the features that are only available in Windows such as SQL routines and calling an external DLL. I did purchase the Euphoria interpreter and LCC compiler and tried the compiled version with no luck. My goal is to write applications that the core of which will run under DOS, Windows and Linux and only change the database or externally called app (DLL) to match the OS. Hope this helps. Nick Mario Steele wrote: > Hey Nick, > > Nick Price wrote: > > I am trying to create an application that I can telnet to that also > > calls an external DLL. > > > > If I create a DOS app telnet works, external DLLs don't. If I create a > > WIN app external DLLs work but I can't run the app in a telnet session. > > > > Any ideas ? > > I'm not exactly sure what you are trying to do exactly, if your trying > to execute Programs from Telnet, and DLL Files, or trying to run DLL > Files from DOS? If you can clear this up a bit, i'll be willing to help > > ya out. > > --( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at > )--|--( at )^.^( at )--|--( at )^.^(@)-- > > > EuMario > Mario Steele > Euphoria Instant Messenger (Soon to Come!) > http://groups.yahoo.com/group/euim/ > >
7. RE: Telnet friendly App
- Posted by Mario Steele <euphmario at yahoo.com> Sep 01, 2002
- 393 views
Hey Nicky, Thank ya kindly for the info, this helps out quite a bit. First off, my question to you is, when you write your EXW File, are you using puts() to do it? If So, Windows will create a New DOS Box, which the output will be shown. Your telnet Daemon will not catch this, because of the way Euphoria uses STDOUT. Under windows, whenever a DOS Box is created, generalized output is never catched in the same way. My Suspicions are, that your Telnet Daemon does not capture the STDOUT from the Window's Created DOS Box, like it would from a Pure DOS Session. There might be a Telnet Daemon out there, that will capture it, I might suggest checking out C|Net Downloads for Telnet Daemon. I know there's a Good one there, but what the name of it is, I don't remember. If I can be of any more help, please let me know. Never give up on your dreams, especially when you know you can achive them. -- Ummm... Me? --( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^(@)-- EuMario Mario Steele Euphoria Instant Messenger (Soon to Come!) http://groups.yahoo.com/group/euim/
8. RE: Telnet friendly App
- Posted by Mario Steele <euphmario at yahoo.com> Sep 01, 2002
- 407 views
Hey Again Nicky, After writting my last post, I got to thinking, and I happen to remember a short cut like way to solve this problem, but would involve writting a Euphoria Program inside a Euphoria Program. What you could do, is create a Specialized Temporary File, in which you can write data in, with the EXW File. And to solve the problem of the STDOUT with EXW files, you can write yourself a Front End EX file, that will execute the EXW File, then when it finishes, you can read the File, grab the data in the file, and print it back out to the screen. To do this trick, I'll give you a small Example: (Note, that I don't actually know how SQL Works, or the wrapper, this is just for Example) -- Win32 Application include sql.ew sequence myData SQL_open("mydatabase.sql") myData = SQL_getField("myCustomer") SQL_close() integer fh fh = open("temp.dat","wb") puts(fh,myData) close(fh) -- DOS Program integer myWait, fh sequence myData myWait = system_exec("exw w32app.exw",2) -- system_exec() will wait for a Return Code, DOS, or Win32 Program. fh = open("temp.dat","rb") myData = gets(fh) close(fh) puts(1,myData) That's all there is to it. This should work, and allow you to Access DLL Files, to get data from it, temporarly put the data into a Simple Text File, and get it back out, and printing it to the screen where the Telnet Daemon can catch it, and post it to your Telnet Screen. Let me know if this works. --( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^( at )--|--( at )^.^(@)-- EuMario Mario Steele Euphoria Instant Messenger (Soon to Come!) http://groups.yahoo.com/group/euim/