[26646] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8753 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Dec 11 14:05:40 2005

Date: Sun, 11 Dec 2005 11:05:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sun, 11 Dec 2005     Volume: 10 Number: 8753

Today's topics:
        Problem with Perl DBI - IO::Socket::INET: <lucas _a_t_ digitalus _dot_ co _dot_ nz>
    Re: Problem with Perl DBI - IO::Socket::INET: <mark.clementsREMOVETHIS@wanadoo.fr>
        smpp perl example <samwun@telpacific.com.au>
    Re: threads <nospam-abuse@ilyaz.org>
    Re: threads <tassilo.von.parseval@rwth-aachen.de>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Sun, 11 Dec 2005 18:33:13 +1300
From: Lucas Young <lucas _a_t_ digitalus _dot_ co _dot_ nz>
Subject: Problem with Perl DBI - IO::Socket::INET:
Message-Id: <439bbb65@news.orcon.net.nz>

Hi all

I'm trying to setup a connection to a Hypersonic SQL database on Ubuntu Linux.
I've installed HSQLDB-BER from 
http://sourceforge.net/projects/hsqldb-ber/ and the server seems to 
start OK, but I get this error running the sample.pl script:

DBI connect('hostname=localhost:9111;url=ber:hsqldb:play','sa',...) 
failed: Failed to open socket to server: IO::Socket::INET: connect: 
Connection refused at sample.pl line 27
Failed to connect: (104) Failed to open socket to server: 
IO::Socket::INET: connect: Connection refused

The line of code is:

$dsn = "dbi:JDBC:hostname=localhost:9111;url=ber:hsqldb:play";

What can cause the IO::Socket::INET:  error, and can you suggest ways 
to debug it?
many thanks in advance



------------------------------

Date: Sun, 11 Dec 2005 12:09:42 +0100
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Problem with Perl DBI - IO::Socket::INET:
Message-Id: <439c08f0$0$29193$8fcfb975@news.wanadoo.fr>

John Bokma wrote:
> Lucas Young <lucas _a_t_ digitalus _dot_ co _dot_ nz> wrote:
> 
>> Hi all
>>
>> I'm trying to setup a connection to a Hypersonic SQL database on
>> Ubuntu Linux. I've installed HSQLDB-BER from 
>> http://sourceforge.net/projects/hsqldb-ber/ and the server seems to 
>> start OK, but I get this error running the sample.pl script:
>>
>> DBI connect('hostname=localhost:9111;url=ber:hsqldb:play','sa',...) 
>> failed: Failed to open socket to server: IO::Socket::INET: connect: 
>> Connection refused at sample.pl line 27
>> Failed to connect: (104) Failed to open socket to server: 
>> IO::Socket::INET: connect: Connection refused
>>
>> The line of code is:
>>
>> $dsn = "dbi:JDBC:hostname=localhost:9111;url=ber:hsqldb:play";
> 
> I doubt if that's line 27, unless $dsn has some magic.
> 

Vim tells me it's line 24 :)

$dsn = "dbi:JDBC:hostname=localhost:9111;url=ber:hsqldb:play";
my %null;

$dbh = DBI->connect($dsn, "sa", "", \%null)
     or ( die("Failed to connect: ($DBI::err) $DBI::errstr\n"));

Lucas: you need to verify that the server is running, and that it is 
listening on the port on which you think it is running. If it produces 
error logs, what is in them? Have you verified that there is a process 
listening on the port to which the sample script is trying to connect
ie does

telnet localhost 9111

connect or do you get connection refused?  lsof is also good for 
diagnosing (among other things) what process is listening on which port. 
What does

lsof -i :9111

return?


What is in the error logs for the server?

Mark




------------------------------

Date: Sun, 11 Dec 2005 14:14:32 +1100
From: sam <samwun@telpacific.com.au>
Subject: smpp perl example
Message-Id: <439b9999$1@news.rivernet.com.au>

Hi,

There are some scatter perl example for the Net::SMPP in cpan.org, but 
they are not realy complete examples. Does anyone have a simple 
Net::SMPP example share with me?

Thanks
Sam


------------------------------

Date: Sun, 11 Dec 2005 07:26:11 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: threads
Message-Id: <dngkaj$281c$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Tassilo v. Parseval
<tassilo.von.parseval@rwth-aachen.de>], who wrote in article <3vvt55F17u5s4U1@news.dfncis.de>:
> threads have such a high overhead on creation (as opposed to threads in
> other environments).
> 
> The actual reason is the fact that Perl threads are interpreter threads,
> meaning that a whole Perl interpreter has to be cloned.

Sorry, Tassilo, but IMO this is pure BS (and I wrote the reasons why
many times).  The reason is that for thread creation Perl uses a
mechanism (cloning) which was designed as a way to circumvent a
completely unrelated problem (absense of fork() in Win* environment)
[and circumvent it only partially].

> The C structure backing up an instance of one interpreter is already
> very big: It has over a hundred members. But that is not all. Each
> and every variable created thus far has to be duplicated as well.

Did you run any benchmark?  In my measurements, cloning takes about
1.5 ORDERS OF MAGNITUDE more time than one needed to create the
initial environment.

Hope this helps,
Ilya


------------------------------

Date: Sun, 11 Dec 2005 08:50:55 +0100
From: "Tassilo v. Parseval" <tassilo.von.parseval@rwth-aachen.de>
Subject: Re: threads
Message-Id: <402432F16rjv2U1@news.dfncis.de>

Also sprach Ilya Zakharevich:

> Tassilo v. Parseval
><tassilo.von.parseval@rwth-aachen.de>], who wrote in article <3vvt55F17u5s4U1@news.dfncis.de>:
>> threads have such a high overhead on creation (as opposed to threads in
>> other environments).
>> 
>> The actual reason is the fact that Perl threads are interpreter threads,
>> meaning that a whole Perl interpreter has to be cloned.
>
> Sorry, Tassilo, but IMO this is pure BS (and I wrote the reasons why
> many times).  The reason is that for thread creation Perl uses a
> mechanism (cloning) which was designed as a way to circumvent a
> completely unrelated problem (absense of fork() in Win* environment)
> [and circumvent it only partially].

I strongly doubt that this was the only reason. Perl's ithreads have
another advantange: Due to the fact that nothing is shared by default,
the conversion of a non-threaded program to using threads is made
easier and will in general keep the program functional without much
further adjustments.

Besides: In my posting I didn't say anything about the why of Perl's
threading model. So even if the fork-emulation on Win32 was the actual
reason, why would not mentioning it render my statement BS? 

>> The C structure backing up an instance of one interpreter is already
>> very big: It has over a hundred members. But that is not all. Each
>> and every variable created thus far has to be duplicated as well.
>
> Did you run any benchmark?  In my measurements, cloning takes about
> 1.5 ORDERS OF MAGNITUDE more time than one needed to create the
> initial environment.

And that surprises you? By the time the cloning happens, a lot more data
is there than at process start-up time: tmp-stacks and pads are usually
already well filled to name but one example. This is all spelled out in
ext/threads/threads.xs:Perl_ithread_create().

> Hope this helps,

Not really. You seem to be implying that all I wrote was nonsense and
wrong. And yet, nothing you wrote contradicts what I said.

Tassilo
-- 
use bigint;
$n=71423350343770280161397026330337371139054411854220053437565440;
$m=-8,;;$_=$n&(0xff)<<$m,,$_>>=$m,,print+chr,,while(($m+=8)<=200);


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 8753
***************************************


home help back first fref pref prev next nref lref last post