.\" -*- coding: UTF-8 -*- .\" Copyright 1993 Rickard E. Faith (faith@cs.unc.edu) .\" Portions extracted from /usr/include/sys/socket.h, which does not have .\" any authorship information in it. It is probably available under the GPL. .\" .\" %%%LICENSE_START(VERBATIM) .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one. .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" %%%LICENSE_END .\" .\" .\" Other portions are from the 6.9 (Berkeley) 3/10/91 man page: .\" .\" Copyright (c) 1983 The Regents of the University of California. .\" 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 .\" .\" Modified 1997-01-31 by Eric S. Raymond .\" Modified 1998, 1999 by Andi Kleen .\" Modified 2004-06-23 by Michael Kerrisk .\" .\"******************************************************************* .\" .\" This file was generated with po4a. Translate the source file. .\" .\"******************************************************************* .TH CONNECT 2 "11. dubna 2020" Linux "Linux \- příručka programátora" .SH JMÉNO connect \- inicializuj spojení soketu .SH POUŽITÍ .nf \fB#include \fP /* Viz POZNÁMKY */ \fB#include \fP .PP \fBint connect(int \fP\fIsockfd\fP\fB, const struct sockaddr *\fP\fIaddr\fP\fB,\fP \fB socklen_t \fP\fIaddrlen\fP\fB);\fP .fi .SH POPIS Systémové volání \fBconnect\fP() připojí soket specifikovaný v \fIsockfd\fP k adrese specifikované v \fIaddr\fP. Parametr \fIaddrlen\fP udává velikost \fIaddr\fP. Formát adresy v \fIaddr\fP je dán adresovým prostorem deskriptoru v \fIsockfd\fP. Viz \fBsocket\fP(2) pro více detailů. .PP Parametr \fIsockfd\fP je soket. Je\-li jeho typ \fBSOCK_DGRAM\fP, pak je \fIaddr\fP jediným místem, odkud a kam budou přijímány, resp. posílány datagramy. Je\-li typ soketu \fBSOCK_STREAM\fP, nebo \fBSOCK_SEQPACKET\fP potom se toto volání pokusí navázat spojení se soketem, který je specifikován v \fIaddr\fP, což je adresa v jmenném prostoru soketu. Každý jmenný prostor interpretuje adresu v \fBaddr\fP. .PP Some protocol sockets (e.g., UNIX domain stream sockets) may successfully \fBconnect\fP() only once. .PP Some protocol sockets (e.g., datagram sockets in the UNIX and Internet domains) may use \fBconnect\fP() multiple times to change their association. .PP Some protocol sockets (e.g., TCP sockets as well as datagram sockets in the UNIX and Internet domains) may dissolve the association by connecting to an address with the \fIsa_family\fP member of \fIsockaddr\fP set to \fBAF_UNSPEC\fP; thereafter, the socket can be connected to another address. (\fBAF_UNSPEC\fP is supported on Linux since kernel 2.2.) .SH "NÁVRATOVÉ HODNOTY" Je\-li spojení navázáno, je vrácena 0, jinak \-1 a externí proměnná \fIerrno\fP je příslušně nastavena. .SH "CHYBOVÉ STAVY" Tento seznam je pouze všeobecný. Mohou existovat další specifické chyby pro použitý jmenný prostor. .TP \fBEACCES\fP Pro sokety UNIXové domény, které jsou identifikovány jménem: je odmítnuto zapisování do souboru specifikovaného soketem, nebo je odmítnuto právo vyhledávat v adresářích specifikovaných cestou. (Viz \fBpath_resolution\fP(7).) .TP \fBEACCES\fP, \fBEPERM\fP Uživatel se pokusil připojit k broadcastové adrese, aniž by měl povolen broadcastový příznak na soketu, nebo požadavek na spojení byl odmítnut kvůli lokálnímu pravidlu firewallu. .IP \fBEACCES\fP can also be returned if an SELinux policy denied a connection (for example, if there is a policy saying that an HTTP proxy can only connect to ports associated with HTTP servers, and the proxy tries to connect to a different port). dd .TP \fBEADDRINUSE\fP Adresa je již používána. .TP \fBEADDRNOTAVAIL\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 \fBEAFNOSUPPORT\fP Poskytnutá adresa nemá správně specifikovanou rodinu adres v poli \fIsa_family\fP. .TP \fBEAGAIN\fP For nonblocking UNIX domain sockets, the socket is nonblocking, and the connection cannot be completed immediately. For other socket families, there are insufficient entries in the routing cache. .TP \fBEALREADY\fP Soket je neblokující a předchozí pokus o spojení ještě nebyl dokončen. .TP \fBEBADF\fP \fIsockfd\fP is not a valid open file descriptor. .TP \fBECONNREFUSED\fP A \fBconnect\fP() on a stream socket found no one listening on the remote address. .TP \fBEFAULT\fP Adresa soketu je mimo adresový prostor procesu. .TP \fBEINPROGRESS\fP The socket is nonblocking and the connection cannot be completed immediately. (UNIX domain sockets failed with \fBEAGAIN\fP instead.) It is possible to \fBselect\fP(2) or \fBpoll\fP(2) for completion by selecting the socket for writing. After \fBselect\fP(2) indicates writability, use \fBgetsockopt\fP(2) to read the \fBSO_ERROR\fP option at level \fBSOL_SOCKET\fP to determine whether \fBconnect\fP() completed successfully (\fBSO_ERROR\fP is zero) or unsuccessfully (\fBSO_ERROR\fP is one of the usual error codes listed here, explaining the reason for the failure). .TP \fBEINTR\fP .\" For TCP, the connection will complete asynchronously. .\" See http://lkml.org/lkml/2005/7/12/254 Systémové volání bylo přerušeno doručením signálu. Viz \fBsignal\fP(7). .TP \fBEISCONN\fP Soket je již spojen. .TP \fBENETUNREACH\fP Síť není dosažitelná. .TP \fBENOTSOCK\fP The file descriptor \fIsockfd\fP does not refer to a socket. .TP \fBEPROTOTYPE\fP The socket type does not support the requested communications protocol. This error can occur, for example, on an attempt to connect a UNIX domain datagram socket to a stream socket. .TP \fBETIMEDOUT\fP Timeout při pokusu o navázání spojení. Server může být příliš zaneprázdněn a není schopen přijmou další spojení. Vězte, že pro IP sokety může být timeout velmi dlouhý, pokud jsou syncookies povoleny na straně serveru. .SH "SPLŇUJE STANDARDY" .\" SVr4 documents the additional .\" general error codes .\" .BR EADDRNOTAVAIL , .\" .BR EINVAL , .\" .BR EAFNOSUPPORT , .\" .BR EALREADY , .\" .BR EINTR , .\" .BR EPROTOTYPE , .\" and .\" .BR ENOSR . .\" It also .\" documents many additional error conditions not described here. POSIX.1\-2001, POSIX.1\-2008, SVr4, 4.4BSD, (\fBconnect\fP() se poprvé objevila ve 4.2BSD). .SH POZNÁMKY 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 For background on the \fIsocklen_t\fP type, see \fBaccept\fP(2). .PP If \fBconnect\fP() fails, consider the state of the socket as unspecified. Portable applications should close the socket and create a new one for reconnecting. .SH PŘÍKLADY Příklad použití \fBconnect\fP() je v \fBgetaddrinfo\fP(3). .SH "DALŠÍ INFORMACE" \fBaccept\fP(2), \fBbind\fP(2), \fBgetsockname\fP(2), \fBlisten\fP(2), \fBsocket\fP(2), \fBpath_resolution\fP(7), \fBselinux\fP(8) .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 .