Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

What opens a TCP port

  • 09-01-2010 2:24pm
    #1
    Registered Users, Registered Users 2 Posts: 5,659 ✭✭✭


    Hi

    I use the following command

    lsof -i :50340

    To check if a certain TCP port is "listening"


    When it is not listening, how do you get it to listen. Is it done from the application itself or is there another way


Comments

  • Registered Users, Registered Users 2 Posts: 9,579 ✭✭✭Webmonkey


    An application must open a socket that listens on a specific port.

    For example, an FTP server would listen on port 21, a web server would listen on port 80 etc.


  • Subscribers Posts: 4,076 ✭✭✭IRLConor


    Q: What opens a TCP port?
    A: A TCP Harbour Master.

    :D

    Seriously though: have a look at netcat (man nc) and you should be able to easily get something listening on a given port. What exactly are you trying to do?


  • Closed Accounts Posts: 4,564 ✭✭✭Naikon


    Just to note, there are two specific types of sockets at least under Unix OS's.

    Domain sockets are used for interprocess communication between local applications
    in Unix(Process communication) whereas Network sockets are used for you guessed
    it...network communication over TCP/IP or whatever the hell you want.


  • Closed Accounts Posts: 4,564 ✭✭✭Naikon


    Hi

    I use the following command

    lsof -i :50340

    To check if a certain TCP port is "listening"


    When it is not listening, how do you get it to listen. Is it done from the application itself or is there another way

    There is a script associated with the application under /etc/init.d/<service.name>
    for SysV like distros like Debian or /etc/rc.d/rc.<service_name> or for BSD like systems.

    So Apache is started with /etc/init.d/apache start, which binds apache to port 80 or a user
    specified port specified by the config file "httpd.conf", which is read by the server at runtime.

    The C application itself opens the port on behalf of the program, by using low
    level socket interfaces detailed in the C standard library.


  • Registered Users, Registered Users 2 Posts: 885 ✭✭✭clearz


    An operating system implements a network stack wich usually handles TCP/IP Each network layer is separate to the one above check out this for more info
    http://en.wikipedia.org/wiki/OSI_model


  • Advertisement
Advertisement