C language function:getservbyname sample codes

Search sample code in the internet.It is the result.


TITLE : August 2009 – AB's Home
snmp_port = socket.getservbyname('snmp', 'udp').......
http://ab.id.au/2009/08/


TITLE : Safari | Linux Socket Programming by Example -> Internet Services
The previously introduced functions enable you to scan the /etc/services file one entry at a time. Often, however, this still proves to be inconvenient because of the amount of code involved. Instead, it would be more convenient to supply the service name and protocol, and have a function return the required entry. The getservbyname(3) function does just that. The function synopsis is as follows:.......
http://alas.matf.bg.ac.rs/manuals/lspe/snode=60.html
TITLE : Safari | Linux Socket Programming by Example -> Internet Services
struct servent *getservbyname(const char *name, const char *proto);.......
http://alas.matf.bg.ac.rs/manuals/lspe/snode=60.html
TITLE : Safari | Linux Socket Programming by Example -> Internet Services
sp = getservbyname("telnet","tcp");.......
http://alas.matf.bg.ac.rs/manuals/lspe/snode=60.html
TITLE : Safari | Linux Socket Programming by Example -> Internet Services
The pointer returned by getservbyname(3) is only valid until the next call to the same function........
http://alas.matf.bg.ac.rs/manuals/lspe/snode=60.html
TITLE : Safari | Linux Socket Programming by Example -> Internet Services
getservbyname(3) 2nd.......
http://alas.matf.bg.ac.rs/manuals/lspe/snode=60.html
TITLE : Safari | Linux Socket Programming by Example -> Internet Services
getservbyname(3) function 2nd.......
http://alas.matf.bg.ac.rs/manuals/lspe/snode=60.html
TITLE : Some common networking operations in Perl « \1
This is done using getservbyname() and getservbyport() for forward and inverse resolution respectively:.......
http://backreference.org/2014/12/11/some-common-networking-operations-in-perl/
TITLE : Some common networking operations in Perl « \1
my ($name, $aliases, $port, $proto) = getservbyname($name, $proto);.......
http://backreference.org/2014/12/11/some-common-networking-operations-in-perl/
TITLE : Some common networking operations in Perl « \1
$ perl -e 'use warnings; use strict; my ($name, $aliases, $port, $proto) = getservbyname($ARGV[0], $ARGV[1]); print "name is: $name, aliases is: $aliases, port is: $port, proto is: $proto\n";' smtp tcp.......
http://backreference.org/2014/12/11/some-common-networking-operations-in-perl/
TITLE : getaddrinfo(), freeaddrinfo(),gai_strerror()
getaddrinfo() is an excellent function that will return information on a particular host name (such as its IP address) and load up a struct sockaddr for you, taking care of the gritty details (like if it's IPv4 or IPv6.) It replaces the old functions gethostbyname() and getservbyname().The description, below, contains a lot of information that might be a little daunting, but actual usage is pretty simple. It might be worth it to check out the examples first........
http://beej.us/guide/bgnet/output/html/multipage/getaddrinfoman.html
TITLE : osmanov / pecl-ev — Bitbucket
$service_port = getservbyname('www', 'tcp');.......
http://bitbucket.org/osmanov/pecl-ev
TITLE : How can I get ServerSocket port number? (Sockets and Internet Protocols forum at Coderanch)
struct servent *getservbyname(const char *name, const char *proto);.......
http://coderanch.com/t/204740/java/ServerSocket-port-number
TITLE : How can I get ServerSocket port number? (Sockets and Internet Protocols forum at Coderanch)
The getservbyname() function returns a servent.......
http://coderanch.com/t/204740/java/ServerSocket-port-number
TITLE : How can I get ServerSocket port number? (Sockets and Internet Protocols forum at Coderanch)
One Java'esque way to emulate the very handy netdb functions would be to define an interface that looks much like the netdb api for getservbyname() etc and then implement this interface with a class that either reads a config file (eg on unix /etc/services) and/or uses JNDI with the NIS adapter to contact NIS........
http://coderanch.com/t/204740/java/ServerSocket-port-number
TITLE : How can I get ServerSocket port number? (Sockets and Internet Protocols forum at Coderanch)
I've got a getservbyname() implementation that uses a NIS - I'll dig it out........
http://coderanch.com/t/204740/java/ServerSocket-port-number
TITLE : getaddrinfo sample_alpha - Shammerism
more flexibility than the gethostbyname(3) and getservbyname(3) functions........
http://d.hatena.ne.jp/shammer/20090926/1390768672
TITLE : Structure of the TCP/IP manager - BlackBerry Native
* getservbyname().......
http://developer.blackberry.com/native/documentation/dev/rtos/arch/tcpip_struct.html
TITLE : Structure of the TCP/IP manager - BlackBerry Native
The getservbyname() function has been modified to contain a small number of builtin services, including ftp, telnet, smtp, domain, nntp, netbios-ns, netbios-ssn, sunrpc, and nfsd. For many applications, this means that the /etc/services file doesn't need to exist........
http://developer.blackberry.com/native/documentation/dev/rtos/arch/tcpip_struct.html

# for efficient getservbyname() avoid nis.......
http://docs.oracle.com/cd/E19253-01/816-4554/ipconfig-42/index.html
TITLE : 17.2. socket Low-level networking interface — Python v3.2.6 documentation
socket.getservbyname(servicename[, protocolname]).......
http://docs.python.org/3.2/library/socket.html
TITLE : class Socket - Documentation for Ruby 2.1.0
getservbyname(service_name) port_number click to toggle source.......
http://docs.ruby-lang.org/en/2.1.0/Socket.html
TITLE : class Socket - Documentation for Ruby 2.1.0
getservbyname(service_name, protocol_name) port_number.......
http://docs.ruby-lang.org/en/2.1.0/Socket.html
TITLE : class Socket - Documentation for Ruby 2.1.0
Socket.getservbyname("smtp") #=> 25.......
http://docs.ruby-lang.org/en/2.1.0/Socket.html
TITLE : class Socket - Documentation for Ruby 2.1.0
Socket.getservbyname("shell") #=> 514.......
http://docs.ruby-lang.org/en/2.1.0/Socket.html
TITLE : class Socket - Documentation for Ruby 2.1.0
Socket.getservbyname("syslog", "udp") #=> 514.......
http://docs.ruby-lang.org/en/2.1.0/Socket.html
TITLE : class Socket - Documentation for Ruby 2.1.0
sock_s_getservbyname(int argc, VALUE *argv).......
http://docs.ruby-lang.org/en/2.1.0/Socket.html
TITLE : class Socket - Documentation for Ruby 2.1.0
sp = getservbyname(servicename, protoname);.......
http://docs.ruby-lang.org/en/2.1.0/Socket.html

Calling getservbyname( ).......
http://docstore.mik.ua/orelly/other/puis3rd/0596003234_puis3-chp-12-sect-1.html
TITLE : Webmail mit Roundcube unter CentOS 7.x [Linux - Wissensdatenbank]
// using getservbyname() function, with 4190 as a fallback........
http://dokuwiki.nausch.org/doku.php/centos%3Amail_c7%3Aroundcube_1
TITLE : windows - GoDoc
* func GetServByName(name string, proto string) (s *Servent, err error).......
http://godoc.org/golang.org/x/sys/windows
TITLE : windows - GoDoc
func GetServByName(name string, proto string) (s *Servent, err error).......
http://godoc.org/golang.org/x/sys/windows
TITLE : bio_do_connect(3): connect BIO - Linux man page
BIO_set_conn_port() sets the port to port. port can be the numerical form or a string such as "http". A string will be looked up first using getservbyname() on the host platform but if that fails a standard table of port names will be used. Currently the list is http, telnet, socks, https, ssl, ftp, gopher and wais........
http://linux.die.net/man/3/bio_do_connect
TITLE : getaddrinfo(3) - Linux manual page
functionality provided by the gethostbyname(3) and getservbyname(3).......
http://man7.org/linux/man-pages/man3/getaddrinfo.3.html
TITLE : Ubuntu Manpage: services - Internet network services list
its service. The C library routines getservent(3), getservbyname(3),.......
http://manpages.ubuntu.com/manpages/trusty/man5/services.5.html
TITLE : Ubuntu Manpage: services - Internet network services list
getservbyname(3), and getservbyport(3). However, this behavior should.......
http://manpages.ubuntu.com/manpages/trusty/man5/services.5.html
TITLE : Ubuntu Manpage: services - Internet network services list
listen(2), endservent(3), getservbyname(3), getservbyport(3),.......
http://manpages.ubuntu.com/manpages/trusty/man5/services.5.html
TITLE : getservbyname and getservbyport Functions in the API (Windows)
struct servent* FAR getservbyname(.......
http://msdn.microsoft.com/en-us/library/windows/desktop/ms738538(v=vs.85).aspx
TITLE : nsswitch.conf - HP-UX
services getservbyname().......
http://nixdoc.net/man-pages/HP-UX/man4/nsswitch.conf.4.html
TITLE : nsswitch.conf - HP-UX
the inet family of entries, gethostbyname(), getservbyname(), and.......
http://nixdoc.net/man-pages/HP-UX/man4/nsswitch.conf.4.html
TITLE : An Introduction to Socket Programming
But programmers don't scan /etc/services, they use library routines. The C library routines getservbyname(3N) (and getservbyport(3N) on the same page) each return a pointer to an object with the following structure containing the broken-out fields of a line in /etc/services........
http://ods.com.ua/win/eng/program/socket/socketprg.html
TITLE : An Introduction to Socket Programming
if ((sp=getservbyname(service,"tcp")) == NULL) then error..........
http://ods.com.ua/win/eng/program/socket/socketprg.html
TITLE : An Introduction to Socket Programming
die("550:Cannot getservbyname($service)\r\n").......
http://ods.com.ua/win/eng/program/socket/socketprg.html
TITLE : An Introduction to Socket Programming
unless ($port = getservbyname($service, 'tcp'));.......
http://ods.com.ua/win/eng/program/socket/socketprg.html
TITLE : Linux-UNIX-Programmierung 11.17 UDP
/td> /td> 11.10.3 Service-Informationen getservbyname() und getservbyport().......
http://openbook.rheinwerk-verlag.de/linux_unix_programmierung/Kap11-016.htm
TITLE : Linux-UNIX-Programmierung 11.17 UDP
Wie schon beim TCP sollte der Client den Namen des Hosts, mit dem er sich unterhalt, und den Dienst, der dort lauft, wissen. Fur diese Informationen kann wieder die Funktion gethostbyname() und getservbyname() verwendet werden........
http://openbook.rheinwerk-verlag.de/linux_unix_programmierung/Kap11-016.htm
TITLE : Porting IPv6 -- examples
sp = getservbyname("login", "tcp");.......
http://osr600doc.xinuos.com/en/SDK_netapi/sockD.PortIPv6examples.html
TITLE : Net::Ping - perldoc.perl.org
$p->port_number(scalar(getservbyname("http", "tcp")));.......
http://perldoc.perl.org/Net/Ping.html
TITLE : Net::Ping - perldoc.perl.org
$p->port_number(getservbyname("http", "tcp"));.......
http://perldoc.perl.org/Net/Ping.html
TITLE : PHP: - Manual
$service_port = getservbyname('www', 'tcp');.......
http://php.net/manual/ja/sockets.examples.php
search Google

https://www.google.com/#q=getservbyname