I am trying to run an application Pharo that requires data from the Ip of the host computer in which it's running. In general I have to open the code to set it manually in my Pharo code then launch the application. Is there a better and programmatically way of getting the IP address and returning this address automatically regardless of the computer? Say I deploy it to different computer.
Is there a specific way to get the Ip of a computer in Pharo smalltalk?
208 Views Asked by ludo At
1
There are 1 best solutions below
Related Questions in SMALLTALK
- Problem Working with Arrays in Pharo 11.0
- On Pharo 11, is it possible to programatically change the traits of a defined class?
- Smalltalk self issue
- How to define a variable in Strongtalk (Smalltalk) and print it
- Understanding Smalltalk Method Invocation with Multiple Colons
- Convert DateTime to formated String on Pharo 11
- Is there a function to check intersection of two timespans in smalltalk?
- smalltalk difference new & initialise
- Sort array that has different types in smalltalk
- Singleton pattern for multi-processing on Pharo 10.0 ( Smalltalk )
- Which methods must I override to enable drag&drop in Squeak?
- Refreshing a Morph without any user interaction
- Why can't methods have the same name in the same class?
- How is ordered a Dictionary in Pharo?
- Smalltalk Prime Generator with a connected list not working
Related Questions in PHARO
- Problem Working with Arrays in Pharo 11.0
- On Pharo 11, is it possible to programatically change the traits of a defined class?
- how to open a file in windows, from Pharo environment?
- Pharo or Squeak: How to get a list of directories and files in a recursive way
- Convert DateTime to formated String on Pharo 11
- Read nested Json Mapping with NeoJSON
- Overriding and extending trait methods in Pharo
- Singleton pattern for multi-processing on Pharo 10.0 ( Smalltalk )
- How to use commandline tools from within pharo
- How to show test results in the console?
- How to log stack traces from seaside in deployed application
- How is ordered a Dictionary in Pharo?
- Can a child component use updateRoot: to add javascript
- Stream assigment in pharo
- Generateing a method via source code in pharo
Related Questions in SEASIDE
- Styling seaside confirm dialog
- How to log stack traces from seaside in deployed application
- Can a child component use updateRoot: to add javascript
- AWS EC2 running a server on 8080 but cannot connect from outside
- Seaside redirect for render not working on physical iOS devices
- Smalltalk Seaside display in threes without using tables
- Multi-web server ajax callback with refresh on Enter
- Seaside & jQuery UI: Sortable list not working?
- Seaside hooks before and after rendering
- Get parent component in Seaside
- Making a hyperlink in Seaside with an image as the clickable item
- Problem Uploading CSS File to Seaside FileLibrary
- Pharo Seaside - How to update a Database entry after editing a tag in html
- Smalltalk Seaside - How do I change the size of a button?
- Cant seem to fully understand how textInput works on a super simple website
Related Questions in GNU-SMALLTALK
- Error in parsing .dat file using GNU Smalltalk
- Smalltalk Prime Generator with a connected list not working
- Smalltalk anomaly - why are the variables always the same, but when computing booleans they are different?
- How to explore a namespace in gnu smalltalk
- Why is assigning many variables seem to mutate my variable?
- Binary Search in smalltalk
- GNU smalltalk run an .st file
- GNU Smalltalk image save state
- Smalltalk: Is there something like "is in" or "is contained"?
- Smalltalk: Setting value of a variable to object
- How to use text file as input to feed in the interactive input of smalltalk and redirect output to a file
- List of methods if their implementation has at least two occurences of a word 'assert' in Smalltalk
- Smalltalk, take command line argument as filename
- Smalltalk - iterate over a dict array with conditions
- Object: true error: did not understand #value while anding booleans together
Related Questions in PHARO-5
- List of methods if their implementation has at least two occurences of a word 'assert' in Smalltalk
- How to do "File in" in Pharo 6.1?
- How do we send a canvas image data as an attachment to a server on Pharo?
- Is it possible to write shell command within Pharo smalltalk?
- Is there a specific way to get the Ip of a computer in Pharo smalltalk?
- How do we run a pharo program without instantiating an object in the playground?
- How do we deploy a Pharo seaside web application?
- Why does my fresh installed Pharo.image does not save as given in the tutorial?
- How do we implement a curl post in pharo
- What could be wrong with this syntax pharos?
- How do we check in pharo if an element already exist in a set
- How do we write if elseif elseif in pharo?
- How do we iterate and select an element of a set in pharo?
- How can we sort dictionaries in an array by a specific key in pharo?
- How can I return a variable contained in a block loop to a method in pharo
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
I think you are searching for
NetResolverName.To get name of your computer:
Then you can use it for the IP address. If you execute in Workspace:
You will get a local network address.
In my case:
#[192 168 1 17]Edit
You can also directly query it via:
Where you will get just:
'192 168 1 17'Note: If you are getting 127.0.0.1
If you are getting
localhostaddress =>127.0.0.1you probably have issues with the host mapping.You can test that with via
ping "hostname"e.g.ping localhost.localdomainwhich will get you replies from127.0.0.1. If you have correct setup (hosts, DNS, etc.) you should get reply from your IP address.When I have changed the
hostnamefromlocalhost.localdomaintosmalltalkthen ping smalltalk correctly replies with192.168.10.30. ThenPharoproduces correct result.