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
27e177d0
Kaydet (Commit)
27e177d0
authored
Mar 16, 1995
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fixed up comments describing interface
üst
f4b012a9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
19 deletions
+18
-19
socketmodule.c
Modules/socketmodule.c
+18
-19
No files found.
Modules/socketmodule.c
Dosyayı görüntüle @
27e177d0
...
@@ -30,43 +30,42 @@ This module provides an interface to Berkeley socket IPC.
...
@@ -30,43 +30,42 @@ This module provides an interface to Berkeley socket IPC.
Limitations:
Limitations:
- only AF_INET and AF_UNIX address families are supported
- only AF_INET and AF_UNIX address families are supported
- no asynchronous I/O (but you can use select() on sockets)
- no read/write operations (use send/recv or makefile instead)
- no read/write operations (use send/recv or makefile instead)
- setsockopt() and getsockopt() only support integer options
I
nterface:
Module i
nterface:
- socket.
gethostname() --> host name (string)
- socket.
error: exception raised for socket specific errors
- socket.gethostbyname(hostname) --> host IP address (string: 'dd.dd.dd.dd')
- socket.gethostbyname(hostname) --> host IP address (string: 'dd.dd.dd.dd')
- socket.gethostbyaddr(IP address) --> (hostname, [alias, ...], [IP addr, ...])
- socket.gethostbyaddr(IP address) --> (hostname, [alias, ...], [IP addr, ...])
- socket.getservbyname(servername, protocolname) --> port number
- socket.gethostname() --> host name (string: 'spam' or 'spam.domain.com')
- socket.getservbyname(servicename, protocolname) --> port number
- socket.socket(family, type [, proto]) --> new socket object
- socket.socket(family, type [, proto]) --> new socket object
- family and type constants from <socket.h> are accessed as socket.AF_INET etc.
- socket.AF_INET, socket.SOCK_STREAM, etc.: constants from <socket.h>
- errors are reported as the exception socket.error
- an Internet socket address is a pair (hostname, port)
- an Internet socket address is a pair (hostname, port)
where hostname can be anything recognized by gethostbyname()
where hostname can be anything recognized by gethostbyname()
(including the dd.dd.dd.dd notation) and port is in host byte order
(including the dd.dd.dd.dd notation) and port is in host byte order
- where a hostname is returned, the dd.dd.dd.dd notation is used
- where a hostname is returned, the dd.dd.dd.dd notation is used
- a UNIX domain socket is a string specifying the pathname
- a UNIX domain socket
address
is a string specifying the pathname
Socket methods:
Socket methods:
- s.accept() --> new socket object, sockaddr
- s.accept() --> new socket object, sockaddr
- s.setsockopt(level, optname, flag) --> Py_None
- s.bind(sockaddr) --> None
- s.getsockopt(level, optname) --> flag
- s.close() --> None
- s.bind(sockaddr) --> Py_None
- s.connect(sockaddr) --> None
- s.connect(sockaddr) --> Py_None
- s.fileno() --> file descriptor
- s.getsockname() --> sockaddr
- s.getpeername() --> sockaddr
- s.getpeername() --> sockaddr
- s.listen(n) --> Py_None
- s.getsockname() --> sockaddr
- s.getsockopt(level, optname[, buflen]) --> int or string
- s.listen(backlog) --> None
- s.makefile([mode[, bufsize]]) --> file object
- s.makefile([mode[, bufsize]]) --> file object
- s.recv(
nbytes
[,flags]) --> string
- s.recv(
buflen
[,flags]) --> string
- s.recvfrom(
nbytes
[,flags]) --> string, sockaddr
- s.recvfrom(
buflen
[,flags]) --> string, sockaddr
- s.send(string [,flags]) --> nbytes
- s.send(string [,flags]) --> nbytes
- s.sendto(string, [flags,] sockaddr) --> nbytes
- s.sendto(string, [flags,] sockaddr) --> nbytes
- s.setblocking(
1 | 0) --> Py_
None
- s.setblocking(
0 | 1) -->
None
- s.s
hutdown(how) --> Py_
None
- s.s
etsockopt(level, optname, value) -->
None
- s.
close() --> Py_
None
- s.
shutdown(how) -->
None
- repr(s) --> "<socket object, fd=%d, family=%d, type=%d, protocol=%d>"
- repr(s) --> "<socket object, fd=%d, family=%d, type=%d, protocol=%d>"
*/
*/
...
...
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