File: connect.2

package info (click to toggle)
manpages-es 0.4a-2
  • links: PTS
  • area: main
  • in suites: hamm, slink
  • size: 3,592 kB
  • ctags: 3
  • sloc: sh: 59; makefile: 42
file content (111 lines) | stat: -rw-r--r-- 5,029 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
.\" Hey Emacs! This file is -*- nroff -*- source.
.\"
.\" 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.
.\"
.\" 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.
.\"
.\"
.\" 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.
.\"
.\" 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.
.\" Translated 1 Jul 1996 miguel A. Sepulveda (angel@vivaldi.princeton.edu)
.\" Modificado Wed Jul 09 16:01:44 1997 por Nicols Lichtmaier <nick@debian.org>
.\"
.TH CONNECT 2 "1 Julio 1996" "Linux 0.99.11" "Manual del Programador Linux"
.SH NOMBRE
connect \- inicia una conexin en un zcalo (socket)
.SH SINOPSIS 
.B #include <sys/types.h>
.br
.B #include <sys/socket.h>
.sp
.BI "int connect(int " sockfd ", struct sockaddr *" serv_addr ", int
.BI " addrlen );
.SH DESCRIPCIN
El parmetro 
.I sockfd
es un descriptor.
Si es del tipo  
.BR SOCK_DGRAM ,
esta llamada especifica el interlocutor (peer) con el que el  zcalo
va a ser asociado; esta direccin es a la que se van a enviar datagramas,
y la nica direccin de la que se van a recibir datagramas. Si el  zcalo
es del tipo
.B SOCK_STREAM ,
esta llamada intenta hacer una conexin a otro  zcalo. El otro  zcalo
est especificado por 
.BR serv_addr ,
el cual es una direccin en el espacio de comunicaciones del  zcalo.
Cada espacio de comunicaciones interpreta el parmetro 
.BR serv_addr ,
a su manera. Generalmente,  zcalos de corriente (stream sockets)
pueden conectarse mediante  
.B connect
una vez solamente;  zcalos de datagramas pueden usar
.B connect
varias veces para cambiar sus asociaciones. Los  zcaloes de datagramas
pueden disolver la asociacin conectando a una direccin invlida, tal como
una direccin nula.
.SH "VALOR REGRESADO"
Si la conexin o enlace tiene xito, se regresa 0. En caso de   
error \-1, y la variable
.I errno
se asigna apropiadamente.
.SH ERRORES
Vanse los fuentes del Kernel Linux para ms detalles.
.SH HISTORIA
La llamada        
.B connect
apareci por primera vez en BSD 4.2.
.SH "VASE TAMBIN"
.BR accept "(2), " bind "(2), " listen "(2), "
.BR socket "(2), " getsockname (2)