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?
206 Views Asked by ludo At
1
There are 1 best solutions below
Related Questions in SMALLTALK
- Create LineMorph From 100@100 to mouse location in smalltalk
- Double dispatch in Pharo
- Syntax for class and instance variables and methods in Pharo 4.0
- Variable types in smalltalk
- How to Check if objectA has all message as objectB in smalltalk?
- Smalltalk syntax highlighting
- How can I add an item in the World-menu of Pharo 4.0?
- How to get name of superclass according to class in smalltalk
- FFI in Squeak: Singleton ExternalLibrary vs. class methods vs. methods in ExternalStructures?
- Smalltalk - How to avoid typechecks in this situation?
- Smalltalk stdin nextLine for fixed number of lines of input
- Squeak doesn't run on Mac OS Sierra
- Can the ifTrue be omitted from an if in smalltalk?
- How to create an arrow morph in smalltalk80 (squeak) programmatically?
- How to implement instance behaviour (for testing) in Cuis/Squeak/Pharo?
Related Questions in PHARO
- Pharo method with multiple arguments
- Double dispatch in Pharo
- Image freeze when a continuation is called
- Syntax for class and instance variables and methods in Pharo 4.0
- Pharo punctuation marks
- How can I add an item in the World-menu of Pharo 4.0?
- Pharo 5.0 - Cannot play sounds - soundStart: snd_add_pcm_handler: Function not implemented
- How to implement instance behaviour (for testing) in Cuis/Squeak/Pharo?
- How to force finalization (for testing) in Cuis/Squeak/Pharo?
- Pharo image does not recognize middle mouse click on Debian
- ZnSecureServer on Pharo3.0 on Ubuntu
- About deprecation and unit testing in Pharo
- Is there a way to swap control and alt keys in Pharo3.0?
- How to print an integer to transcript
- How to add an entry to context menus in Nautilus?
Related Questions in SEASIDE
- Smalltalk syntax highlighting
- When using HTML <select> tag, changed 'selected' value not displayed in Firefox
- Referencing the selected text in a textarea
- Remove method in Seaside
- How to get an element's position in real time
- Seaside: list losing its content on update
- How can I change how single element paths are handled in Seaside?
- Where to start learning about Seaside internals?
- Getting the value of a JQueryInstance
- Including fonts in Seaside
- Updating Reef parts on the fly
- Seaside calling a component inside javascript
- Tab Widget in jquery - Seaside- Pharo smalltalk
- Default JQuery UI Tabs
- Any reason not to write my own HTML?
Related Questions in GNU-SMALLTALK
- Variable types in smalltalk
- How to Check if objectA has all message as objectB in smalltalk?
- How to get name of superclass according to class in smalltalk
- Smalltalk stdin nextLine for fixed number of lines of input
- How to override equality method in Smalltalk?
- Smalltalk change variable value
- How to see object/class/context browser in GNU Smalltalk?
- How to just get key only on GNU Smalltalk?
- vwnt pop up in smalltalk
- How to have an instance variable that is an array
- GNU Smalltalk - Break from whileTrue loop without return
- Binary Search in smalltalk
- Smalltalk Vandermonde-matrix
- Smalltalk: Assigning to a Variable Without Declaring a Variable in GNU Smalltalk
- How to concatenate a string in a do block?
Related Questions in PHARO-5
- How can we fill a html text area on pharo
- How can I refresh a JSON file for a certain period in pharo
- How can I return a variable contained in a block loop to a method in pharo
- How to do "File in" in Pharo 6.1?
- How do we run a pharo program without instantiating an object in the playground?
- Why does my fresh installed Pharo.image does not save as given in the tutorial?
- How do we deploy a Pharo seaside web application?
- How do we send a canvas image data as an attachment to a server on Pharo?
- Is there a specific way to get the Ip of a computer in Pharo smalltalk?
- Is it possible to write shell command within Pharo smalltalk?
- How do we implement a curl post in pharo
- List of methods if their implementation has at least two occurences of a word 'assert' in Smalltalk
- openWorldWithSpec making it impossible to return to previous windows
- How can I refresh a session for every 60 second and display it on transcript with Pharo?
- Pharo Smalltalk test failure because message not understood
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 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.