Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7989361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T12:43:59+00:00 2026-06-04T12:43:59+00:00

Using snap-server’s httpServe method, I can setPort 0 to instruct the server to connect

  • 0

Using snap-server’s httpServe method, I can setPort 0 to instruct the server to connect on the next free port. Unfortunately, once I have started the http server, I can’t find any way to determine which port it actually started on. As an example, my first try started on port 2679 – is there any way to determine that number?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T12:44:00+00:00Added an answer on June 4, 2026 at 12:44 pm

    I wrote this patch, included with snap-server 0.9 and above, using which you can write:

    let hook dat = print $ socketPort $ head $ getStartupSockets dat
    let config = setStartupHook hook $ setPort 0 mempty
    httpServer config ...
    

    Now hook will be called after the server is ready, and will print the port it started on.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Script goes to the remote server and runs a shell script snap.sh using Net::SSH::Perl.
I know that you can control an MMC snap-in using the MMC 2.0 Automation
I'm on an MVC3 project and I am using snap structuremap for my dependecy
I'm building an app that allows users to snap pictures using the iPhone camera,
Trying to use the following demo example, using the 80px x 80px snap to
Using ruby(1.8.7) , rails(2.3.8) , rspec(1.3.1) and rspec-rails(1.3.3) how do I test a method
Here's my problem: I have server A, running node.js and using socket.io for communicating
I've got a Python webservice using SOAPpy. The webservice server is structured as shown
I'm using Snap.com service to create snapshots to Wikipedia links on my web page.
I'm currently logged into my Windows Server 2008 R2 (x64) server, using Remote Desktop.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.