Opening a socket connection on a serial port

Discussion in 'Perl Misc' started by John Ramsden, Jul 16, 2003.

  1. John Ramsden

    John Ramsden Guest

    I have a perl script that needs to control connects and
    disconnects of a dialup connection, and transfer data via
    a TCP socket stream opened on it. This must work on Windows
    and Unix.

    After poking about on CPAN and elsewhere, I concluded that
    for the basic modem control I need the Devel::SerialPort
    module.

    (Question in passing: Does Devel::SerialPort work on Windows
    as well as Unix? The documentation says it was derived for
    POSIX from Win32::SerialPort.)

    But I'm not sure how to identify or map (?) this so that
    my script can use it for a TCP socket connection.

    Any advice, and/or pointers to code samples would be greatly
    appreciated.

    To put things in context, this requirement is for a security
    hyperaware customer, who insists that the system on which my
    monitoring package will runs must have no network link to the
    outside world.

    But as it may be linked to a local LAN, I can't assume the
    modem will be the _only_ possibility for a socket connection
    to use. Hence the need to somehow tie the socket open request
    explicitly to the modem.

    Thanks in advance.


    Cheers

    John Ramsden ()
    John Ramsden, Jul 16, 2003
    #1
    1. Advertising

  2. On 16 Jul 2003 09:37:49 -0700, John Ramsden <> wrote:
    > I have a perl script that needs to control connects and
    > disconnects of a dialup connection, and transfer data via
    > a TCP socket stream opened on it. This must work on Windows
    > and Unix.
    >
    > (Question in passing: Does Devel::SerialPort work on Windows
    > as well as Unix? The documentation says it was derived for
    > POSIX from Win32::SerialPort.)


    Device::SerialPort is a Unix port of Win32::SerialPort. So you use
    Win32::SerialPort in Windows, and Device::SerialPort in Linux or Unix.

    While that could chat with a modem, dialout to a shell, communicate
    with a shell, it will NOT do TCP/IP.

    TCP/IP would work easiest (transparently) if the user already had an
    automatic PPP connection set up in Windows DUN, or demand pppd set up in
    Unix.

    Otherwise, if you are trying to initiate the PPP connection from your
    script, I know how to do that in Linux or FreeBSD (assuming script running
    as user that has permission to do that), but could not begin to guess how
    to do that on various Win systems (which may also have permission issues).

    --
    David Efflandt - All spam ignored http://www.de-srv.com/
    http://www.autox.chicago.il.us/ http://www.berniesfloral.net/
    http://cgi-help.virtualave.net/ http://hammer.prohosting.com/~cgi-wiz/
    David Efflandt, Jul 16, 2003
    #2
    1. Advertising

  3. John Ramsden

    John Ramsden Guest

    (David Efflandt) wrote in message news:<>...
    > On 16 Jul 2003 09:37:49 -0700, John Ramsden <> wrote:
    > > I have a perl script that needs to control connects and
    > > disconnects of a dialup connection, and transfer data via
    > > a TCP socket stream opened on it. This must work on Windows
    > > and Unix.
    > >
    > > (Question in passing: Does Devel::SerialPort work on Windows
    > > as well as Unix? The documentation says it was derived for
    > > POSIX from Win32::SerialPort.)

    >
    > Device::SerialPort is a Unix port of Win32::SerialPort. So you use
    > Win32::SerialPort in Windows, and Device::SerialPort in Linux or Unix.


    Ah, OK. Sounds reasonable.

    > While that could chat with a modem, dialout to a shell, communicate
    > with a shell, it will NOT do TCP/IP.
    >
    > TCP/IP would work easiest (transparently) if the user already had an
    > automatic PPP connection set up in Windows DUN, or demand pppd set up in
    > Unix.
    >
    > Otherwise, if you are trying to initiate the PPP connection from your
    > script, I know how to do that in Linux or FreeBSD


    If this is fairly simple, and remotely perl-ish, would there be any
    chance of posting a summary or a pointer?

    > [...]


    Many thanks for your reply. I'm gradually getting an idea of roughly
    what is required; so now it's just a matter of sussing out the details.


    Cheers

    John Ramsden ()
    John Ramsden, Jul 17, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pom
    Replies:
    2
    Views:
    1,651
    Bas-i
    Jan 31, 2007
  2. Kr Alfabeta
    Replies:
    13
    Views:
    679
    Slan Dizier
    May 8, 2008
  3. Sangeeta Huddar

    serial port connection

    Sangeeta Huddar, Mar 13, 2009, in forum: Ruby
    Replies:
    4
    Views:
    130
  4. Replies:
    1
    Views:
    562
    Toni Erdmann
    Mar 2, 2005
  5. msalerno
    Replies:
    3
    Views:
    409
    Ilmari Karonen
    Jul 14, 2005
Loading...

Share This Page