1. ODBC.e : port used by existing connection
- Posted by Rad <radhx at re?iffmail.co?> Oct 13, 2007
- 628 views
Hi, Is there a way to get the port number used by an existing connection? Regards, Rad.
2. Re: ODBC.e : port used by existing connection
- Posted by jacques deschênes <desja at gl?b?trotter.net> Oct 13, 2007
- 604 views
Rad wrote: > > Hi, > > Is there a way to get the port number used by an existing connection? > > Regards, > Rad. Hi Rad, open cmd.exe and type netstat > netstat.txt the open netstat.txt in notepad this will give you all the tcp/ip connections. jacques d.
3. Re: ODBC.e : port used by existing connection
- Posted by Rad <radhx at rediffm??l.com> Oct 14, 2007
- 625 views
jacques deschênes wrote: > open cmd.exe and type netstat > netstat.txt > the open netstat.txt in notepad > this will give you all the tcp/ip connections. > Hi Jacques, I would like to get the port number from within my Euphoria application. Regards, Rad.
4. Re: ODBC.e : port used by existing connection
- Posted by Matt Lewis <matthewwalkerlewis at g?ail.com> Oct 14, 2007
- 671 views
Rad wrote: > > jacques deschênes wrote: > > open cmd.exe and type netstat > netstat.txt > > the open netstat.txt in notepad > > this will give you all the tcp/ip connections. > > > > Hi Jacques, > > I would like to get the port number from within my Euphoria application. You might try using SQLBrowseConnect(): http://msdn2.microsoft.com/en-us/library/ms714565.aspx Matt
5. Re: ODBC.e : port used by existing connection
- Posted by jacques deschênes <desja at globetrot?er?net> Oct 14, 2007
- 625 views
Matt Lewis wrote: > > Rad wrote: > > > > jacques deschênes wrote: > > > open cmd.exe and type netstat > netstat.txt > > > the open netstat.txt in notepad > > > this will give you all the tcp/ip connections. > > > > > > > Hi Jacques, > > > > I would like to get the port number from within my Euphoria application. > > You might try using SQLBrowseConnect(): > <a > href="http://msdn2.microsoft.com/en-us/library/ms714565.aspx">http://msdn2.microsoft.com/en-us/library/ms714565.aspx</a> > > Matt Or you can use capture.ew to capture the output of the net stat command:
include capture.ew -- see rapideuphoria archive object handles, line sequence lines integer fi handles = capture_exec("net stat -a -b",CAPTURE_STDOUT)--get all connections with application name if atom(handle) then puts(1,"failed to capture child process\n") else fi = handles[siSTDOUT] lines = {} line = capture_gets(fi) while sequence(line) do lines = append(lines,line) line = capture_gets(fi) end while capture_terminate() end if -- now you can filter lines to get needed information
regards, Jacques d.
6. Re: ODBC.e : port used by existing connection
- Posted by jacques deschênes <desja at globe?r?tter.net> Oct 14, 2007
- 640 views
jacques deschênes wrote: > > Matt Lewis wrote: > > > > Rad wrote: > > > > > > jacques deschênes wrote: > > > > open cmd.exe and type netstat > netstat.txt > > > > the open netstat.txt in notepad > > > > this will give you all the tcp/ip connections. > > > > > > > > > > Hi Jacques, > > > > > > I would like to get the port number from within my Euphoria application. > > > > You might try using SQLBrowseConnect(): > > <a > > href="http://msdn2.microsoft.com/en-us/library/ms714565.aspx">http://msdn2.microsoft.com/en-us/library/ms714565.aspx</a> > > > > Matt > > Or you can use capture.ew to capture the output of the net stat command: > > }}} <eucode> > include capture.ew -- see rapideuphoria archive > > object handles, line > sequence lines > integer fi > handles = capture_exec("net stat -a -b",CAPTURE_STDOUT)--get all connections > with application name > if atom(handle) then > puts(1,"failed to capture child process\n") > else > fi = handles[siSTDOUT] > lines = {} > line = capture_gets(fi) > while sequence(line) do > lines = append(lines,line) > line = capture_gets(fi) > end while > capture_terminate() > > end if > -- now you can filter lines to get needed information > </eucode> {{{ > > regards, > Jacques d. whoops! posted without testing the code. replace "net stat -a -b" by "netstat -a -b" replace if atom(handle) by if atom(handles) jacques d.