⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 net-common-tcpip-manpages-getpeername.html

📁 有关ecos2。0介绍了实时嵌入式的结构以及线程调度的实现和内存的管理等
💻 HTML
字号:
<!-- Copyright (C) 2003 Red Hat, Inc.                                --><!-- This material may be distributed only subject to the terms      --><!-- and conditions set forth in the Open Publication License, v1.0  --><!-- or later (the latest version is presently available at          --><!-- http://www.opencontent.org/openpub/).                           --><!-- Distribution of the work or derivative of the work in any       --><!-- standard (paper) book form is prohibited unless prior           --><!-- permission is obtained from the copyright holder.               --><HTML><HEAD><TITLE>getpeername</TITLE><meta name="MSSmartTagsPreventParsing" content="TRUE"><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+"><LINKREL="HOME"TITLE="eCos Reference Manual"HREF="ecos-ref.html"><LINKREL="UP"TITLE="TCP/IP Library Reference"HREF="tcpip-library-reference.html"><LINKREL="PREVIOUS"TITLE="connect"HREF="net-common-tcpip-manpages-connect.html"><LINKREL="NEXT"TITLE="getsockname"HREF="net-common-tcpip-manpages-getsockname.html"></HEAD><BODYCLASS="SECT1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLESUMMARY="Header navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">eCos Reference Manual</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="net-common-tcpip-manpages-connect.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 38. TCP/IP Library Reference</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="net-common-tcpip-manpages-getsockname.html"ACCESSKEY="N">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="SECT1"><H1CLASS="SECT1"><ANAME="NET-COMMON-TCPIP-MANPAGES-GETPEERNAME">getpeername</H1><TABLEBORDER="5"BGCOLOR="#E0E0F0"WIDTH="70%"><TR><TD><PRECLASS="SCREEN">GETPEERNAME(2)                System Calls Manual               GETPEERNAME(2)NAME     getpeername - get name of connected peerSYNOPSIS     #include &lt;sys/types.h&#62;     #include &lt;sys/socket.h&#62;     int     getpeername(int s, struct sockaddr *name, socklen_t *namelen);DESCRIPTION     getpeername() returns the address information of the peer connected to     socket s.  One common use occurs when a process inherits an open socket,     such as TCP servers forked from inetd(8).  In this scenario,     getpeername() is used to determine the connecting client's IP address.     getpeername() takes three parameters:     s Contains the file descriptor of the socket whose peer should be looked     up.     name Points to a sockaddr structure that will hold the address informa-     tion for the connected peer.  Normal use requires one to use a structure     specific to the protocol family in use, such as sockaddr_in (IPv4) or     sockaddr_in6 (IPv6), cast to a (struct sockaddr *).     For greater portability, especially with the newer protocol families, the     new struct sockaddr_storage should be used.  sockaddr_storage is large     enough to hold any of the other sockaddr_* variants.  On return, it can     be cast to the correct sockaddr type, based the protocol family contained     in its ss_family field.     namelen Indicates the amount of space pointed to by name, in bytes.     If address information for the local end of the socket is required, the     getsockname(2) function should be used instead.     If name does not point to enough space to hold the entire socket address,     the result will be truncated to namelen bytes.RETURN VALUES     If the call succeeds, a 0 is returned and namelen is set to the actual     size of the socket address returned in name.  Otherwise, errno is set and     a value of -1 is returned.ERRORS     On failure, errno is set to one of the following:     [EBADF]            The argument s is not a valid descriptor.     [ENOTSOCK]         The argument s is a file, not a socket.     [ENOTCONN]         The socket is not connected.     [ENOBUFS]          Insufficient resources were available in the system to                        perform the operation.     [EFAULT]           The name parameter points to memory not in a valid                        part of the process address space.SEE ALSO     accept(2), bind(2), getsockname(2), getpeereid(2), socket(2)HISTORY     The getpeername() function call appeared in 4.2BSD.BSD                              July 17, 1999                             BSD    </PRE></TD></TR></TABLE></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLESUMMARY="Footer navigation table"WIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="net-common-tcpip-manpages-connect.html"ACCESSKEY="P">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="ecos-ref.html"ACCESSKEY="H">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="net-common-tcpip-manpages-getsockname.html"ACCESSKEY="N">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">connect</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="tcpip-library-reference.html"ACCESSKEY="U">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">getsockname</TD></TR></TABLE></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -