Newbie: Does Socket ping: 'addr' work in Pharo3.11.8 ?
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. -- View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp221... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
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.... 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-tp221... 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
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....
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-tp221... 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-tp221... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
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....
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-tp221...
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-tp221... 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
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....
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-tp221...
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-tp221... 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-tp221... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
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
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! -- View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp221... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
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
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! -- View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp221... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
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-tp221... 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
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
Thanks ron for the offer as you can see in http://code.google.com/p/pharo/issues/detail?id=1884 we got a bit burned by the status of the network code. So if you can try some expressions with the latest unstable 1.1 it would help us to know if we should apply the rollback fix. Lukas sent a call in pharo-dev for testers but probably not in pharo-users. stef On May 16, 2010, at 8:46 PM, Ron Jeffries wrote:
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 Pharo-users@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
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 Pharo-users@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
I really appreciate the feedback from Stef, Mariano and Ron! As a newbie, that is a good "reality check" for me. Thanks again guys! -- View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp221... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
I would have love to give you a real answer. I'm doing pharo because I want a beautiful system from which people (and me) can learn. I want to be enlightened by beautiful code. Stef On May 16, 2010, at 8:42 PM, RickT wrote:
I really appreciate the feedback from Stef, Mariano and Ron! As a newbie, that is a good "reality check" for me. Thanks again guys! -- View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp221... 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
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 <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....
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-tp221... 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-tp221... 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
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-tp221... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
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-tp221... 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
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 <Rick@emarysville.com> 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-tp221... 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
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 <Rick@emarysville.com> 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-tp221... 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
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. -- View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp221... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
On 16/05/2010 17:36, RickT wrote:
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)
The problem is that the Socket>>#ping: does not do the same thing as the command line utilities. The DOS and Unix ping utilities send an *ICMP* echo request packet and expects an echo response. This is normally handled by the protocol stack itself. The Pharo #ping: method makes a *TCP* connection to port 10 (echo service) on the destination machine. If there's no server listening on that port, the connection will fail. Here's the method comment, emphasis added "Ping the given host. Useful for checking network connectivity. *The host must be running a TCP echo server*."
Thanks douglas. Stef On May 17, 2010, at 2:18 PM, Douglas Brebner wrote:
On 16/05/2010 17:36, RickT wrote:
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)
The problem is that the Socket>>#ping: does not do the same thing as the command line utilities.
The DOS and Unix ping utilities send an ICMP echo request packet and expects an echo response. This is normally handled by the protocol stack itself.
The Pharo #ping: method makes a TCP connection to port 10 (echo service) on the destination machine. If there's no server listening on that port, the connection will fail.
Here's the method comment, emphasis added "Ping the given host. Useful for checking network connectivity. The host must be running a TCP echo server." _______________________________________________ Pharo-users mailing list Pharo-users@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
On Mon, May 17, 2010 at 2:18 PM, Douglas Brebner < squeaklists@fang.demon.co.uk> wrote:
On 16/05/2010 17:36, RickT wrote:
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)
The problem is that the Socket>>#ping: does not do the same thing as the command line utilities.
The DOS and Unix ping utilities send an *ICMP* echo request packet and expects an echo response. This is normally handled by the protocol stack itself.
The Pharo #ping: method makes a *TCP* connection to port 10 (echo service) on the destination machine. If there's no server listening on that port, the connection will fail.
Thanks for the explanation :) Now...isn't it 7 by default ? So you can try the method #pingPortsOn: hostName which does: pingPortsOn: hostName "Attempt to connect to a set of well-known sockets on the given host, and answer the names of the available ports." "Socket pingPortsOn: 'www.disney.com'" ^ Socket pingPorts: #(7 13 19 21 23 25 80 110 119) on: hostName timeOutSecs: 20 ;) Mariano
Here's the method comment, emphasis added
"Ping the given host. Useful for checking network connectivity. *The host must be running a TCP echo server*."
_______________________________________________ Pharo-users mailing list Pharo-users@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-users
On 17/05/2010 13:44, Mariano Martinez Peck wrote:
On Mon, May 17, 2010 at 2:18 PM, Douglas Brebner <squeaklists@fang.demon.co.uk <mailto:squeaklists@fang.demon.co.uk>> wrote:
On 16/05/2010 17:36, RickT wrote:
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)
The problem is that the Socket>>#ping: does not do the same thing as the command line utilities.
The DOS and Unix ping utilities send an *ICMP* echo request packet and expects an echo response. This is normally handled by the protocol stack itself.
The Pharo #ping: method makes a *TCP* connection to port 10 (echo service) on the destination machine. If there's no server listening on that port, the connection will fail.
Thanks for the explanation :)
Now...isn't it 7 by default ?
So you can try the method #pingPortsOn: hostName
which does:
pingPortsOn: hostName "Attempt to connect to a set of well-known sockets on the given host, and answer the names of the available ports." "Socket pingPortsOn: 'www.disney.com <http://www.disney.com>'"
^ Socket pingPorts: #(7 13 19 21 23 25 80 110 119) on: hostName timeOutSecs: 20
;)
I believe some intrusion detection software would identify that as a hostile scan looking for vulnerabilities :) The best thing would be to change #ping: to use ICMP but iirc that requires a raw socket and thus root permission under unix. Alas.
Thanks for the great response! I am not only a newbie to Smalltalk but also to any sort of network programming. I guess my exposure to 'ping' on other systems was always the ICMP flavor; so I was surprised by this implementation. As Mariano pointed out, the source code in Pharo1.0 indicates port 7: tcpPort := 7. "7 = echo port, 13 = time port, 19 = character generator port" It seems to me that a ping: method should be the ICMP kind, and a ping:port: method should be for the TCP variety. I presume an echo server could be run on ports other than 7 or 10, depending on preference. So maybe the port should be designated by the caller, and not hard-coded into the class method. I see the other reasoning from your response. Thanks again for clarifying this (and educating me). -- View this message in context: http://forum.world.st/Newbie-Does-Socket-ping-addr-work-in-Pharo3-11-8-tp221... Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
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-tp221... 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
participants (5)
-
Douglas Brebner -
Mariano Martinez Peck -
RickT -
Ron Jeffries -
Stéphane Ducasse