.\" -*- coding: UTF-8 -*- .\" Copyright (c) 1983, 1991 The Regents of the University of California. .\" and Copyright (C) 2007, Michael Kerrisk .\" All rights reserved. .\" .\" %%%LICENSE_START(BSD_4_CLAUSE_UCB) .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. All advertising materials mentioning features or use of this software .\" must display the following acknowledgement: .\" This product includes software developed by the University of .\" California, Berkeley and its contributors. .\" 4. Neither the name of the University nor the names of its contributors .\" may be used to endorse or promote products derived from this software .\" without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" %%%LICENSE_END .\" .\" $Id: listen.2,v 1.6 1999/05/18 14:10:32 freitag Exp $ .\" .\" Modified Fri Jul 23 22:07:54 1993 by Rik Faith .\" Modified 950727 by aeb, following a suggestion by Urs Thuermann .\" .\" Modified Tue Oct 22 08:11:14 EDT 1996 by Eric S. Raymond .\" Modified 1998 by Andi Kleen .\" Modified 11 May 2001 by Sam Varshavchik .\" .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH LISTEN 2 "9. června 2020" Linux "Linux \- příručka programátora" .SH JMÉNO listen \- čekej na spojení na soketu .SH POUŽITÍ .nf \fB#include \fP /* Viz POZNÁMKY */ \fB#include \fP .PP \fBint listen(int \fP\fIsockfd\fP\fB, int \fP\fIbacklog\fP\fB);\fP .fi .SH POPIS Funkce \fBlisten\fP() označí soket specifikovaný parametrem \fIsockfd\fP jako pasivní, to znamená, že soket bude použit pro přijetí požadavků příchozích spojení pomocí funkce \fBaccept\fP(2). .PP Parametr \fIsockfd\fP je file deskriptor, který popisuje soket, který je typu \fBSOCK_STREAM\fP nebo \fBSOCK_SEQPACKET\fP. .PP Parametr \fIbacklog\fP specifikuje maximální délku, do které fronta čekajících požadavků na spojení prostřednictvím \fIsockfd\fP může dorůst. Je\-li fronta zaplněna, obdrží klient zprávu \fBECONNREFUSED\fP nebo pokud to nižší vrstva podporuje znovuzaslání, požadavek může být ignorován a pozdější pokus o spojení uspěje. .SH "NÁVRATOVÉ HODNOTY" Je\-li volání úspěšné, vrací se 0, jinak \-1 a je nastavena proměnná \fIerrno\fP. .SH "CHYBOVÉ STAVY" .TP \fBEADDRINUSE\fP Jiný soket už naslouchá na daném portu. .TP \fBEADDRINUSE\fP (Internet domain sockets) The socket referred to by \fIsockfd\fP had not previously been bound to an address and, upon attempting to bind it to an ephemeral port, it was determined that all port numbers in the ephemeral port range are currently in use. See the discussion of \fI/proc/sys/net/ipv4/ip_local_port_range\fP in \fBip\fP(7). .TP \fBEBADF\fP Argument \fIsockfd\fP není platným deskriptorem. .TP \fBENOTSOCK\fP The file descriptor \fIsockfd\fP does not refer to a socket. .TP \fBEOPNOTSUPP\fP Typ soketu není podporován voláním \fBlisten\fP. .SH "SPLŇUJE STANDARDY" POSIX.1\-2001, POSIX.1\-2008, 4.4BSD. \fBlisten\fP() se poprvé objevilo v 4.2BSD. .SH POZNÁMKY K přijetí spojení jsou provedeny tyto kroky: .RS 4 .IP 1. 4 Je vytvořen soket pomocí \fBsocket\fP(2). .IP 2. Soket je navázán na lokální adresu pomocí \fBbind\fP(2), takže další sokety na něj mohou být napojeny pomocí \fBconnect\fP(2). .IP 3. Ochota k přijetí příchozího spojení a limit pro délku fronty jsou specifikovány pomocí \fBlisten\fP(). .IP 4. Spojení je přijato pomocí \fBaccept\fP(2). .RE .PP POSIX.1 nevyžaduje vložení \fI\fP a proto není tento hlavičkový soubor v Linuxu vyžadován. Nicméně některé starší (BSD) implementace jej vyžadují a v přenositelných aplikacích by také bylo tento hlavičkový soubor zachovat. .PP The behavior of the \fIbacklog\fP argument on TCP sockets changed with Linux 2.2. Now it specifies the queue length for \fIcompletely\fP established sockets waiting to be accepted, instead of the number of incomplete connection requests. The maximum length of the queue for incomplete sockets can be set using \fI/proc/sys/net/ipv4/tcp_max_syn_backlog\fP. When syncookies are enabled there is no logical maximum length and this setting is ignored. See \fBtcp\fP(7) for more information. .PP .\" The following is now rather historic information (MTK, Jun 05) .\" Don't rely on this value in portable applications since BSD .\" (and some BSD-derived systems) limit the backlog to 5. If the \fIbacklog\fP argument is greater than the value in \fI/proc/sys/net/core/somaxconn\fP, then it is silently truncated to that value. Since Linux 5.4, the default in this file is 4096; in earlier kernels, the default value is 128. In kernels before 2.4.25, this limit was a hard coded value, \fBSOMAXCONN\fP, with the value 128. .SH PŘÍKLADY Viz \fBbind\fP(2). .SH "DALŠÍ INFORMACE" \fBaccept\fP(2), \fBbind\fP(2), \fBconnect\fP(2), \fBsocket\fP(2), \fBsocket\fP(7) .SH TIRÁŽ Tato stránka je součástí projektu Linux \fIman\-pages\fP v5.10. Popis projektu a informace o hlášení chyb najdete na \%https://www.kernel.org/doc/man\-pages/. .PP .SH PŘEKLAD Překlad této příručky do španělštiny vytvořili Pavel Heimlich . .PP Tento překlad je bezplatná dokumentace; Přečtěte si .UR https://www.gnu.org/licenses/gpl-3.0.html GNU General Public License Version 3 .UE nebo novější ohledně podmínek autorských práv. Neexistuje ŽÁDNÁ ODPOVĚDNOST. .PP Pokud narazíte na nějaké chyby v překladu této příručky, pošlete e-mail na adresu .MT translation-team-cs@lists.sourceforge.net .ME .