Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
2a7178ef
Kaydet (Commit)
2a7178ef
authored
Ara 08, 1992
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
socketmodule.c: added socket.fromfd(fd, family, type, [proto]);
converted socket() to use of getargs().
üst
6209b97d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
8 deletions
+32
-8
socketmodule.c
Modules/socketmodule.c
+32
-8
No files found.
Modules/socketmodule.c
Dosyayı görüntüle @
2a7178ef
...
...
@@ -933,15 +933,12 @@ socket_socket(self, args)
object
*
args
;
{
sockobject
*
s
;
int
family
,
type
,
proto
,
fd
;
if
(
args
!=
NULL
&&
is_tupleobject
(
args
)
&&
gettuplesize
(
args
)
==
3
)
{
if
(
!
getintintintarg
(
args
,
&
family
,
&
type
,
&
proto
))
return
NULL
;
}
else
{
if
(
!
getintintarg
(
args
,
&
family
,
&
type
))
int
fd
,
family
,
type
,
proto
;
proto
=
0
;
if
(
!
getargs
(
args
,
"(ii)"
,
&
family
,
&
type
))
{
err_clear
();
if
(
!
getargs
(
args
,
"(iii)"
,
&
family
,
&
type
,
&
proto
))
return
NULL
;
proto
=
0
;
}
BGN_SAVE
fd
=
socket
(
family
,
type
,
proto
);
...
...
@@ -960,6 +957,32 @@ socket_socket(self, args)
}
/* Create a socket object from a numeric file description.
Useful e.g. if stdin is a socket.
Additional arguments as for socket(). */
/*ARGSUSED*/
static
object
*
socket_fromfd
(
self
,
args
)
object
*
self
;
object
*
args
;
{
sockobject
*
s
;
int
fd
,
family
,
type
,
proto
;
proto
=
0
;
if
(
!
getargs
(
args
,
"(iii)"
,
&
fd
,
&
family
,
&
type
))
{
err_clear
();
if
(
!
getargs
(
args
,
"(iiii)"
,
&
fd
,
&
family
,
&
type
,
&
proto
))
return
NULL
;
}
s
=
newsockobject
(
fd
,
family
,
type
,
proto
);
/* From now on, ignore SIGPIPE and let the error checking
do the work. */
(
void
)
signal
(
SIGPIPE
,
SIG_IGN
);
return
(
object
*
)
s
;
}
/* List of functions exported by this module. */
static
struct
methodlist
socket_methods
[]
=
{
...
...
@@ -967,6 +990,7 @@ static struct methodlist socket_methods[] = {
{
"gethostname"
,
socket_gethostname
},
{
"getservbyname"
,
socket_getservbyname
},
{
"socket"
,
socket_socket
},
{
"fromfd"
,
socket_fromfd
},
{
NULL
,
NULL
}
/* Sentinel */
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment