1. ODBC.e : port used by existing connection

Hi, 

Is there a way to get the port number used by an existing connection?

Regards,
Rad.

new topic     » topic index » view message » categorize

2. Re: ODBC.e : port used by existing connection

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.

new topic     » goto parent     » topic index » view message » categorize

3. Re: ODBC.e : port used by existing connection

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.

new topic     » goto parent     » topic index » view message » categorize

4. Re: ODBC.e : port used by existing connection

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: ODBC.e : port used by existing connection

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.

new topic     » goto parent     » topic index » view message » categorize

6. Re: ODBC.e : port used by existing connection

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.

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu