LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-01-2015, 05:46 AM   #1
gauravpathak129
LQ Newbie
 
Registered: Jan 2014
Location: Pune, Maharashtra
Distribution: Fedora 17, Ubuntu 12.04
Posts: 18

Rep: Reputation: Disabled
Socket discoverable by avahi


Hello all,

Is it possible to advertise the port number of a custom created socket to be discoverable by other machines on network via zeroconf discovery?

I have a simple socket server C program, all I want is to make it as an avahi service. How can I achieve this?
 
Old 04-01-2015, 08:40 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by gauravpathak129 View Post
Hello all,
Is it possible to advertise the port number of a custom created socket to be discoverable by other machines on network via zeroconf discovery? I have a simple socket server C program, all I want is to make it as an avahi service. How can I achieve this?
The first place to start, would be for you to look on Google for information. Did you??? Because putting "how to create an avahi service" in, pulls up lots...such as these, the first two hits:
https://wiki.archlinux.org/index.php...dding_Services
http://holyarmy.org/2008/01/advertis...-avahibonjour/

...which are complete with examples.
 
Old 04-01-2015, 03:19 PM   #3
gauravpathak129
LQ Newbie
 
Registered: Jan 2014
Location: Pune, Maharashtra
Distribution: Fedora 17, Ubuntu 12.04
Posts: 18

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
The first place to start, would be for you to look on Google for information. Did you??? Because putting "how to create an avahi service" in, pulls up lots...such as these, the first two hits:
https://wiki.archlinux.org/index.php...dding_Services
http://holyarmy.org/2008/01/advertis...-avahibonjour/

...which are complete with examples.
Yes, I did looked on Google. I only got how to publish a service using "avahi-publish". I want to know that how can I make my C program as an avahi service in which I created a socket for accepting connections.
 
Old 04-02-2015, 08:51 AM   #4
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by gauravpathak129 View Post
Yes, I did looked on Google. I only got how to publish a service using "avahi-publish". I want to know that how can I make my C program as an avahi service in which I created a socket for accepting connections.
That has absolutely NOTHING to do with avahi. After you get your program working, you advertise it. To break it down into two steps:
  • Get your program (written in C or whatever else), working and listening on whatever port you'd like.
  • Follow the well-documented steps to advertise it via avahi
 
1 members found this post helpful.
Old 04-02-2015, 02:55 PM   #5
gauravpathak129
LQ Newbie
 
Registered: Jan 2014
Location: Pune, Maharashtra
Distribution: Fedora 17, Ubuntu 12.04
Posts: 18

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
That has absolutely NOTHING to do with avahi. After you get your program working, you advertise it. To break it down into two steps:
  • Get your program (written in C or whatever else), working and listening on whatever port you'd like.
  • Follow the well-documented steps to advertise it via avahi
Thank you. I was misunderstood, I thought that avahi will handle all the things.
 
Old 04-02-2015, 04:15 PM   #6
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,635

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by gauravpathak129 View Post
Thank you. I was misunderstood, I thought that avahi will handle all the things.
That's why doing basic research first is a good thing. There is ample documentation about avahi, what it does, how it does it, and how to configure it.
 
  


Reply

Tags
avahi, socket, zeroconf



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't get avahi to install (trying to get Netatalk and Avahi running) MarcusWebb1966 Gentoo 4 07-28-2011 03:55 AM
Can't connect to UNIX socket /var/run/clamav/clamd.socket ganick Linux - Server 8 08-01-2008 01:22 PM
AF_LOCAL domain socket versus AF_INET socket performance zzaappp Linux - General 0 06-19-2008 07:50 AM
Bluetooth not discoverable DragonM15 Linux - Hardware 3 03-12-2007 08:03 PM
Unable to connect to UNIX socket /tmp/.esd/socket error while using grip dr_zayus69 Linux - Software 4 08-23-2005 07:28 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration