Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
27 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

RickT
I installed the one-click version on Windows (XP) recently and am learning Smalltalk.  I am under the impression that in a Shout Workspace I can execute the line

Socket ping: 'localhost'

(or some valid address).  But I always get a message that it timed out.  I can successfully ping the same address in a command window.  Any guidance would be appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Mariano Martinez Peck


On Sun, May 16, 2010 at 4:28 AM, RickT <[hidden email]> wrote:

I installed the one-click version on Windows (XP) recently and am learning
Smalltalk.  

Welcome! we hope you enjoy :)
 
I am under the impression that in a Shout Workspace I can
execute the line

Socket ping: 'localhost'

(or some valid address).  But I always get a message that it timed out.  I
can successfully ping the same address in a command window.  

Sorry I don't understand. Where you can successfully ping ?   what's is a command window? do you mean DOS or somehow outside Pharo?

Can you try the same after evaluating:

NetNameResolver classVarNamed: 'UseOldNetwork'  put:  true

Can you try also the same but using a PharoCore 1.1 image (you can use the same VM):

https://gforge.inria.fr/frs/download.php/26995/PharoCore-1.1-11357-UNSTABLE.zip

Thanks!

Mariano
 
Any guidance
would be appreciated.

--
View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218247.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users


_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Stéphane Ducasse
In reply to this post by RickT

On May 16, 2010, at 4:28 AM, RickT wrote:

>
> I installed the one-click version on Windows (XP) recently and am learning
> Smalltalk.

Welcome and do not hesitate questions - we are all learning :)

>  I am under the impression that in a Shout Workspace I can
> execute the line
>
> Socket ping: 'localhost'
>
> (or some valid address).  But I always get a message that it timed out.  I
> can successfully ping the same address in a command window.  Any guidance
> would be appreciated.
>
> --
> View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218247.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Pharo-users mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users


_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

RickT
In reply to this post by Mariano Martinez Peck
I am loving the Smalltalk environment and language very much, thanks!  (But I remain an ignorant newbie nonetheless.) I hope to later explore Seaside with Pharo as well.

To my problem:

With the Pharo 1.0 image, the classVarNamed:put: message was not understood.  (Same for Linux version of Pharo 1.0).

With the Pharo 1.1 image you linked me to, the message was understood, but had no effect.

I still cannot get Socket>>ping: to work; it always times out.

And yes, I meant the OS command window ping worked.  For Windows XP it is what you would call the DOS command line.  I also downloaded and tried the Pharo1.0 in my VirtualBox VM running Ubuntu.  I have the same problem:  I can ping localhost from the Linux command line, but Pharo 1.0 ping always times out.

(I am running on a Dell M90 Precision laptop. FWIW)

Thanks very much for your help.

Mariano Martinez Peck wrote
On Sun, May 16, 2010 at 4:28 AM, RickT <Rick@emarysville.com> wrote:

>
> I installed the one-click version on Windows (XP) recently and am learning
> Smalltalk.


Welcome! we hope you enjoy :)


> I am under the impression that in a Shout Workspace I can
> execute the line
>
> Socket ping: 'localhost'
>
> (or some valid address).  But I always get a message that it timed out.  I
> can successfully ping the same address in a command window.


Sorry I don't understand. Where you can successfully ping ?   what's is a
command window? do you mean DOS or somehow outside Pharo?

Can you try the same after evaluating:

NetNameResolver classVarNamed: 'UseOldNetwork'  put:  true

Can you try also the same but using a PharoCore 1.1 image (you can use the
same VM):

https://gforge.inria.fr/frs/download.php/26995/PharoCore-1.1-11357-UNSTABLE.zip

Thanks!

Mariano


> Any guidance
> would be appreciated.
>
> --
> View this message in context:
> http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218247.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Pharo-users mailing list
> Pharo-users@lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
>

_______________________________________________
Pharo-users mailing list
Pharo-users@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Mariano Martinez Peck


On Sun, May 16, 2010 at 6:36 PM, RickT <[hidden email]> wrote:

I am loving the Smalltalk environment and language very much, thanks!  (But I
remain an ignorant newbie nonetheless.) I hope to later explore Seaside with
Pharo as well.


Excellent. Just in case you don't know:

http://pharobyexample.org/
http://book.seaside.st/book

and in progress: http://book.pharo-project.org/
 
To my problem:

With the Pharo 1.0 image, the classVarNamed:put: message was not understood.
(Same for Linux version of Pharo 1.0).

Ups...sorry. Actually that was for breaking encapsulation as NetNameResolver does not have a setter for such class variable.
To do a quick test just implement a class side method in NetNameResolver like this:

useOldNetwork: aBoolean
    UseOldNetwork := aBoolean

And then evaluate:

NetNameResolver useOldNetwork: true.


With the Pharo 1.1 image you linked me to, the message was understood, but
had no effect.

I still cannot get Socket>>ping: to work; it always times out.


Ok...the network package is not the best in Pharo and we had several problems :(

 
And yes, I meant the OS command window ping worked.  For Windows XP it is
what you would call the DOS command line.  I also downloaded and tried the
Pharo1.0 in my VirtualBox VM running Ubuntu.  I have the same problem:  I
can ping localhost from the Linux command line, but Pharo 1.0 ping always
times out.


Ok...I know very little about network but maybe someone can help you.

cheers

mariano

 
(I am running on a Dell M90 Precision laptop. FWIW)

Thanks very much for your help.


Mariano Martinez Peck wrote:
>
> On Sun, May 16, 2010 at 4:28 AM, RickT <[hidden email]> wrote:
>
>>
>> I installed the one-click version on Windows (XP) recently and am
>> learning
>> Smalltalk.
>
>
> Welcome! we hope you enjoy :)
>
>
>> I am under the impression that in a Shout Workspace I can
>> execute the line
>>
>> Socket ping: 'localhost'
>>
>> (or some valid address).  But I always get a message that it timed out.
>> I
>> can successfully ping the same address in a command window.
>
>
> Sorry I don't understand. Where you can successfully ping ?   what's is a
> command window? do you mean DOS or somehow outside Pharo?
>
> Can you try the same after evaluating:
>
> NetNameResolver classVarNamed: 'UseOldNetwork'  put:  true
>
> Can you try also the same but using a PharoCore 1.1 image (you can use the
> same VM):
>
> https://gforge.inria.fr/frs/download.php/26995/PharoCore-1.1-11357-UNSTABLE.zip
>
> Thanks!
>
> Mariano
>
>
>> Any guidance
>> would be appreciated.
>>
>> --
>> View this message in context:
>> http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218247.html
>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Pharo-users mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
>>
>
> _______________________________________________
> Pharo-users mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
>
>

--
View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218658.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users


_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

RickT
In reply to this post by RickT
I bought the Seaside book and am reading it and PBE.  (I also stumbled upon the other book in progress by reading one of your postings.)

In Pharo1.0 image, when I defined the class useOldNetwork: message, it did not understand the UseOldNetwork variable to be assigned aBoolean, so I had to declare the class variable.  It did not help ping work either.

Does the Socket>>ping: work for you?  Or am I the only one breaking on this?

Thanks for your help!

Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

RickT
In reply to this post by Mariano Martinez Peck
I bought the Seaside book and am reading it and PBE.  (I also stumbled upon the other book in progress by reading one of your postings.)

In Pharo1.0 image, when I defined the class useOldNetwork: message, it did not understand the UseOldNetwork variable to be assigned aBoolean, so I had to declare the class variable.  It did not help ping work either.

Does the Socket>>ping: work for you?  Or am I the only one breaking on this?

Thanks for your help!
Mariano Martinez Peck wrote
On Sun, May 16, 2010 at 6:36 PM, RickT <Rick@emarysville.com> wrote:

>
> I am loving the Smalltalk environment and language very much, thanks!  (But
> I
> remain an ignorant newbie nonetheless.) I hope to later explore Seaside
> with
> Pharo as well.
>
>
Excellent. Just in case you don't know:

http://pharobyexample.org/
http://book.seaside.st/book

and in progress: http://book.pharo-project.org/


> To my problem:
>
> With the Pharo 1.0 image, the classVarNamed:put: message was not
> understood.
> (Same for Linux version of Pharo 1.0).
>

Ups...sorry. Actually that was for breaking encapsulation as NetNameResolver
does not have a setter for such class variable.
To do a quick test just implement a class side method in NetNameResolver
like this:

useOldNetwork: aBoolean
    UseOldNetwork := aBoolean

And then evaluate:

NetNameResolver useOldNetwork: true.


> With the Pharo 1.1 image you linked me to, the message was understood, but
> had no effect.
>
> I still cannot get Socket>>ping: to work; it always times out.
>
>
Ok...the network package is not the best in Pharo and we had several
problems :(



> And yes, I meant the OS command window ping worked.  For Windows XP it is
> what you would call the DOS command line.  I also downloaded and tried the
> Pharo1.0 in my VirtualBox VM running Ubuntu.  I have the same problem:  I
> can ping localhost from the Linux command line, but Pharo 1.0 ping always
> times out.
>
>
Ok...I know very little about network but maybe someone can help you.

cheers

mariano



> (I am running on a Dell M90 Precision laptop. FWIW)
>
> Thanks very much for your help.
>
>
> Mariano Martinez Peck wrote:
> >
> > On Sun, May 16, 2010 at 4:28 AM, RickT <Rick@emarysville.com> wrote:
> >
> >>
> >> I installed the one-click version on Windows (XP) recently and am
> >> learning
> >> Smalltalk.
> >
> >
> > Welcome! we hope you enjoy :)
> >
> >
> >> I am under the impression that in a Shout Workspace I can
> >> execute the line
> >>
> >> Socket ping: 'localhost'
> >>
> >> (or some valid address).  But I always get a message that it timed out.
> >> I
> >> can successfully ping the same address in a command window.
> >
> >
> > Sorry I don't understand. Where you can successfully ping ?   what's is a
> > command window? do you mean DOS or somehow outside Pharo?
> >
> > Can you try the same after evaluating:
> >
> > NetNameResolver classVarNamed: 'UseOldNetwork'  put:  true
> >
> > Can you try also the same but using a PharoCore 1.1 image (you can use
> the
> > same VM):
> >
> >
> https://gforge.inria.fr/frs/download.php/26995/PharoCore-1.1-11357-UNSTABLE.zip
> >
> > Thanks!
> >
> > Mariano
> >
> >
> >> Any guidance
> >> would be appreciated.
> >>
> >> --
> >> View this message in context:
> >>
> http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218247.html
> >> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
> >>
> >> _______________________________________________
> >> Pharo-users mailing list
> >> Pharo-users@lists.gforge.inria.fr
> >> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
> >>
> >
> > _______________________________________________
> > Pharo-users mailing list
> > Pharo-users@lists.gforge.inria.fr
> > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
> >
> >
>
> --
> View this message in context:
> http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218658.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Pharo-users mailing list
> Pharo-users@lists.gforge.inria.fr
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
>

_______________________________________________
Pharo-users mailing list
Pharo-users@lists.gforge.inria.fr
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Stéphane Ducasse
In reply to this post by RickT

On May 16, 2010, at 6:36 PM, RickT wrote:

>
> I am loving the Smalltalk environment and language very much, thanks!  (But I
> remain an ignorant newbie nonetheless.) I hope to later explore Seaside with
> Pharo as well.
>
> To my problem:
>
> With the Pharo 1.0 image, the classVarNamed:put: message was not understood.
> (Same for Linux version of Pharo 1.0).

can you show the expression you are using?

why do you need that method?

It was indeed missing so we added it in 1.1

Class>>classVarNamed: name put: anObject
        "Store anObject in the class variable."
       
        | symbol |
        symbol := name asSymbol.
        (self classPool includesKey: symbol) ifFalse:  [^self error: 'no such lass var'].
        self classPool at: symbol put: anObject.


> With the Pharo 1.1 image you linked me to, the message was understood, but
> had no effect.

Really?
Again do you have an expression that we can try.

>
> I still cannot get Socket>>ping: to work; it always times out.
>
> And yes, I meant the OS command window ping worked.  For Windows XP it is
> what you would call the DOS command line.  I also downloaded and tried the
> Pharo1.0 in my VirtualBox VM running Ubuntu.  I have the same problem:  I
> can ping localhost from the Linux command line, but Pharo 1.0 ping always
> times out.
>
> (I am running on a Dell M90 Precision laptop. FWIW)
>
> Thanks very much for your help.
>
>
> Mariano Martinez Peck wrote:
>>
>> On Sun, May 16, 2010 at 4:28 AM, RickT <[hidden email]> wrote:
>>
>>>
>>> I installed the one-click version on Windows (XP) recently and am
>>> learning
>>> Smalltalk.
>>
>>
>> Welcome! we hope you enjoy :)
>>
>>
>>> I am under the impression that in a Shout Workspace I can
>>> execute the line
>>>
>>> Socket ping: 'localhost'
>>>
>>> (or some valid address).  But I always get a message that it timed out.
>>> I
>>> can successfully ping the same address in a command window.
>>
>>
>> Sorry I don't understand. Where you can successfully ping ?   what's is a
>> command window? do you mean DOS or somehow outside Pharo?
>>
>> Can you try the same after evaluating:
>>
>> NetNameResolver classVarNamed: 'UseOldNetwork'  put:  true
>>
>> Can you try also the same but using a PharoCore 1.1 image (you can use the
>> same VM):
>>
>> https://gforge.inria.fr/frs/download.php/26995/PharoCore-1.1-11357-UNSTABLE.zip
>>
>> Thanks!
>>
>> Mariano
>>
>>
>>> Any guidance
>>> would be appreciated.
>>>
>>> --
>>> View this message in context:
>>> http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218247.html
>>> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>>>
>>> _______________________________________________
>>> Pharo-users mailing list
>>> [hidden email]
>>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
>>>
>>
>> _______________________________________________
>> Pharo-users mailing list
>> [hidden email]
>> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
>>
>>
>
> --
> View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218658.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Pharo-users mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users


_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Ron Jeffries
In reply to this post by RickT
Hello, RickT.  On Sunday, May 16, 2010, at 1:14:14 PM, you wrote:

> Does the Socket>>ping: work for you?  Or am I the only one breaking on this?

I am seeing a failure similar to the one that you are when pinging
localhost or my own web site from Pharao, or the example in the
Socket class>>ping: method. I see this in Windows XP and .. hold on
... Windows 7.

If I do Socket ping: 'localhost' I get a popup about "Continue to
wait for connection to localhost". When I finally say Yes to this,
it returns Socket class, as shown in the method:

Socket class>>ping: hostName
        "Ping the given host. Useful for checking network connectivity. The host must be running a TCP echo server."
        "Socket ping: 'squeak.cs.uiuc.edu'"

        | tcpPort sock serverAddr startTime echoTime |
        tcpPort := 7.  "7 = echo port, 13 = time port, 19 = character generator port"

        serverAddr := NetNameResolver addressForName: hostName timeout: 10.
        serverAddr = nil ifTrue: [
                ^ self inform: 'Could not find an address for ', hostName].

        sock := Socket new.
        sock connectNonBlockingTo: serverAddr port: tcpPort.
        [sock waitForConnectionFor: 10]
                on: ConnectionTimedOut
                do: [:ex |
                        (self confirm: 'Continue to wait for connection to ', hostName, '?')
                                ifTrue: [ex retry]
                                ifFalse: [
                                        sock destroy.
                                        ^ self]].

        sock sendData: 'echo!'.
        startTime := Time millisecondClockValue.
        [sock waitForDataFor: 15]
                on: ConnectionTimedOut
                do: [:ex | (self confirm: 'Packet sent but no echo yet; keep waiting?')
                        ifTrue: [ex retry]].
        echoTime := Time millisecondClockValue - startTime.

        sock destroy.
        self inform: hostName, ' responded in ', echoTime printString, ' milliseconds'.

There is no class variable in NetNameResolver named UseOldNetwork.

I am using Pharo-1.0
Latest update: #10517

Thanks,

Ron Jeffries
www.XProgramming.com
www.xprogramming.com/blog
Knowledge must come through action;
you can have no test which is not fanciful,
save by trial. --  Sophocles


_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Stéphane Ducasse
In reply to this post by RickT
in Pharo1.1 latest unstable

        Socket ping: 'localhost' barks immediately

        Socket ping: 'www.google.com' gets blocked

Yes we will have drastically improve the network.

Stef

_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

RickT
In reply to this post by Ron Jeffries
Hi Ron,

Yes, you are having the same experience.  Mariano asked me to try the UseOldNetwork in Pharo1.0, but as you say, it does not exist.  It does in 1.1 image which is not yet released (I think).

I think we are stuck with a non-working ping.

Thanks for responding!
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

RickT
In reply to this post by Stéphane Ducasse
Hi Stefan,

Mariano asked me to try using that method to set UseOldNetwork.

I only was testing the class method Socket>>ping: from the workspace, and it always timed out.

It also did not work in the Pharo1.1 image that Mariano asked me to try.

Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Stéphane Ducasse
In reply to this post by Ron Jeffries
yes I get the same behavior
in 1.1, 1.0 and in latest squeak trunk.
I tried to ping www.google.com or its ip.

Network code is probably the same since Squeak3.9.

in 1.0 mike rueger started to fix it. Then we had to rollback parts of the change because of IVP6 problems
In 1.1 we have the version mike did and we should improve it. We are waited from feedback to see if we will do the same rollback as in
1.0.

Stef



On May 16, 2010, at 8:17 PM, Ron Jeffries wrote:

> Hello, RickT.  On Sunday, May 16, 2010, at 1:14:14 PM, you wrote:
>
>> Does the Socket>>ping: work for you?  Or am I the only one breaking on this?
>
> I am seeing a failure similar to the one that you are when pinging
> localhost or my own web site from Pharao, or the example in the
> Socket class>>ping: method. I see this in Windows XP and .. hold on
> ... Windows 7.
>
> If I do Socket ping: 'localhost' I get a popup about "Continue to
> wait for connection to localhost". When I finally say Yes to this,
> it returns Socket class, as shown in the method:
>
> Socket class>>ping: hostName
>        "Ping the given host. Useful for checking network connectivity. The host must be running a TCP echo server."
>        "Socket ping: 'squeak.cs.uiuc.edu'"
>
>        | tcpPort sock serverAddr startTime echoTime |
>        tcpPort := 7.  "7 = echo port, 13 = time port, 19 = character generator port"
>
>        serverAddr := NetNameResolver addressForName: hostName timeout: 10.
>        serverAddr = nil ifTrue: [
>                ^ self inform: 'Could not find an address for ', hostName].
>
>        sock := Socket new.
>        sock connectNonBlockingTo: serverAddr port: tcpPort.
>        [sock waitForConnectionFor: 10]
>                on: ConnectionTimedOut
>                do: [:ex |
>                        (self confirm: 'Continue to wait for connection to ', hostName, '?')
>                                ifTrue: [ex retry]
>                                ifFalse: [
>                                        sock destroy.
>                                        ^ self]].
>
>        sock sendData: 'echo!'.
>        startTime := Time millisecondClockValue.
>        [sock waitForDataFor: 15]
>                on: ConnectionTimedOut
>                do: [:ex | (self confirm: 'Packet sent but no echo yet; keep waiting?')
>                        ifTrue: [ex retry]].
>        echoTime := Time millisecondClockValue - startTime.
>
>        sock destroy.
>        self inform: hostName, ' responded in ', echoTime printString, ' milliseconds'.
>
> There is no class variable in NetNameResolver named UseOldNetwork.
>
> I am using Pharo-1.0
> Latest update: #10517
>
> Thanks,
>
> Ron Jeffries
> www.XProgramming.com
> www.xprogramming.com/blog
> Knowledge must come through action;
> you can have no test which is not fanciful,
> save by trial. --  Sophocles
>
>
> _______________________________________________
> Pharo-users mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users


_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Stéphane Ducasse
In reply to this post by RickT

On May 16, 2010, at 8:26 PM, RickT wrote:

>
> Hi Ron,
>
> Yes, you are having the same experience.  Mariano asked me to try the
> UseOldNetwork in Pharo1.0, but as you say, it does not exist.  It does in
> 1.1 image which is not yet released (I think).
>
> I think we are stuck with a non-working ping.

Yes probably.

> Thanks for responding!
> --
> View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218753.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Pharo-users mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users


_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Stéphane Ducasse
In reply to this post by RickT
Ok I missed the beginning of the thread :)
On May 16, 2010, at 8:30 PM, RickT wrote:

>
> Hi Stefan,
>
> Mariano asked me to try using that method to set UseOldNetwork.
>
> I only was testing the class method Socket>>ping: from the workspace, and it
> always timed out.
>
> It also did not work in the Pharo1.1 image that Mariano asked me to try.
>
> Thanks!
> --
> View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218755.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Pharo-users mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users


_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Mariano Martinez Peck
In reply to this post by RickT
Hi guys. No, it doesn't work for me neither. I have checked in Pharo 1.0 and 1.1 with both: useOldNetwork as true and false.

I have debugged a little the:

Socket ping: 'localhost'

And the problem I found is that after calling "connectNonBlockingTo: hostAddress port: port"

 self primSocketConnectionStatus: socketHandle.

should answer something different thanUnconnected ( 0 ), like WaitingForConnection (1)  or Connected (2)
check Socket class >> initialize

So....I should see in VM side why primSocketConnectionStatus: socketHandle.  may be returning 0 (unconnected).

Now...if I ping

 Socket ping: 'www.google.com'

The result is different as I get WaitingForConnection (1) instead of 0....but it loops forever as I always get 1 and never 2....see the loop

[(status = WaitingForConnection) and: [(msecsEllapsed := Time millisecondsSince: startTime) < msecsDelta]]
        whileTrue: [
            semaphore waitTimeoutMSecs: msecsDelta - msecsEllapsed.
            status := self primSocketConnectionStatus: socketHandle].

in the method waitForConnectionFor: timeout ifTimedOut: timeoutBlock

I will continue to check, but my knowledge in this area is almost nil.

Cheers

Mariano

On Sun, May 16, 2010 at 8:30 PM, RickT <[hidden email]> wrote:

Hi Stefan,

Mariano asked me to try using that method to set UseOldNetwork.

I only was testing the class method Socket>>ping: from the workspace, and it
always timed out.

It also did not work in the Pharo1.1 image that Mariano asked me to try.

Thanks!
--
View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218755.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.

_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users


_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

RickT
In reply to this post by Stéphane Ducasse
I really appreciate the feedback from Stef, Mariano and Ron!
As a newbie, that is a good "reality check" for me.
Thanks again guys!
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Stéphane Ducasse
In reply to this post by Mariano Martinez Peck
which is cool because you can learn fast :)
I like to try to answer questions because this is a good way to learn.
Thanks for having this cool attitude too.
Stef

> Hi guys. No, it doesn't work for me neither. I have checked in Pharo 1.0 and 1.1 with both: useOldNetwork as true and false.
>
> I have debugged a little the:
>
> Socket ping: 'localhost'
>
> And the problem I found is that after calling "connectNonBlockingTo: hostAddress port: port"
>
>  self primSocketConnectionStatus: socketHandle.
>
> should answer something different thanUnconnected ( 0 ), like WaitingForConnection (1)  or Connected (2)
> check Socket class >> initialize
>
> So....I should see in VM side why primSocketConnectionStatus: socketHandle.  may be returning 0 (unconnected).
>
> Now...if I ping
>
>  Socket ping: 'www.google.com'
>
> The result is different as I get WaitingForConnection (1) instead of 0....but it loops forever as I always get 1 and never 2....see the loop
>
> [(status = WaitingForConnection) and: [(msecsEllapsed := Time millisecondsSince: startTime) < msecsDelta]]
>         whileTrue: [
>             semaphore waitTimeoutMSecs: msecsDelta - msecsEllapsed.
>             status := self primSocketConnectionStatus: socketHandle].
>
> in the method waitForConnectionFor: timeout ifTimedOut: timeoutBlock
>
> I will continue to check, but my knowledge in this area is almost nil.
>
> Cheers
>
> Mariano
>
> On Sun, May 16, 2010 at 8:30 PM, RickT <[hidden email]> wrote:
>
> Hi Stefan,
>
> Mariano asked me to try using that method to set UseOldNetwork.
>
> I only was testing the class method Socket>>ping: from the workspace, and it
> always timed out.
>
> It also did not work in the Pharo1.1 image that Mariano asked me to try.
>
> Thanks!
> --
> View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp2218247p2218755.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Pharo-users mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
>
> _______________________________________________
> Pharo-users mailing list
> [hidden email]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users


_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Ron Jeffries
In reply to this post by Stéphane Ducasse
Hello, Stéphane.  On Sunday, May 16, 2010, at 2:35:22 PM, you
wrote:

>> UseOldNetwork in Pharo1.0, but as you say, it does not exist.  It does in
>> 1.1 image which is not yet released (I think).
>>
>> I think we are stuck with a non-working ping.

> Yes probably.

I looked briefly for other HTTP examples to try. Didn't see any. If
anyone has something to try, please let me know ...

Ron Jeffries
www.XProgramming.com
www.xprogramming.com/blog
Learn from yesterday, live for today, hope for tomorrow.
The important thing is to not stop questioning. --Albert Einstein


_______________________________________________
Pharo-users mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
Reply | Threaded
Open this post in threaded view
|

Re: Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

RickT
In reply to this post by Mariano Martinez Peck
Hi Mariano,

Your debugging efforts match what I was finding.

I was originally having problems with Socket>>connect: , which kept failing. So I thought I would just try the most minimal thing, ping.  There may be problems with Socket class in general.

Thanks again.
12