Re: [Pharo-users] Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

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

Re: [Pharo-users] 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-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-users] 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-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-users] Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Mariano Martinez Peck
In reply to this post by Mariano Martinez Peck
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-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: [Pharo-users] Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?

Stéphane Ducasse
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-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project