📄 wysockfile.3wy
字号:
.PP Write \fIcount\fP bytes of data in \fIbuf\fP to the system file The number of written bytes is always stored into \fIn_written\fP.PP [\fBRet\fP] Ok Succeed Wym_EBADF Object is not valid for the operation Wym_EINVAL Object attatched device is not suitable Wym_EFAULT \fIbuf\fP is inaccessible Wym_EFBIG Attempt to write beyond the device limit Wym_EPIPE Write to a pipe or FIFO with no reader Wym_EAGAIN Non-blocking I/O (write would block) Wym_EINTR Interrupted by a signal before data written Wym_ENOSPC Device left no space for the operation Wym_EIO Low level I/O error.PP [\fBRefer\fP] ::write(int,const void*,size_t).\"--------------------------------------------.PP.BI "virtual WyRet write(WyCSeg " "buf" ", size_t& " "n_written" ")".PP Write data indicated by \fIbuf\fP to the system file The number of written bytes is always stored into \fIn_written\fP.PP [\fBRet\fP] Ok Succeed Wym_EBADF Object is not valid for the operation Wym_EINVAL Object attatched device is not suitable Wym_EFBIG Attempt to write beyond the device limit Wym_EPIPE Write to a pipe or FIFO with no reader Wym_EAGAIN Non-blocking I/O (write would block) Wym_EINTR Interrupted by a signal before data written Wym_ENOSPC Device left no space for the operation Wym_EIO Low level I/O error.PP [\fBRefer\fP] ::write(int,const void*,size_t).\"--------------------------------------------.PP.BI "virtual WyRet write(const WyStr& " "buf" ", size_t& " "n_written" ")".PP Write data in \fIbuf\fP to the system file The number of written bytes is always stored into \fIn_written\fP.PP [\fBRet\fP] Ok Succeed Wym_EBADF Object is not valid for the operation Wym_EINVAL Object attatched device is not suitable Wym_EFBIG Attempt to write beyond the device limit Wym_EPIPE Write to a pipe or FIFO with no reader Wym_EAGAIN Non-blocking I/O (write would block) Wym_EINTR Interrupted by a signal before data written Wym_ENOSPC Device left no space for the operation Wym_EIO Low level I/O error.PP [\fBRefer\fP] ::write(int,const void*,size_t).\"--------------------------------------------.PP.BI "int family(void) const throw()".PP Get socket protocol family.PP [\fBRet\fP] Protocol family of *this(PF_...). PF_UNSPEC is returned if object is default..\"--------------------------------------------.PP.BI "WyRet sockname(Wy_SockAddr& " "addr" ") const".PP Reset \fIaddr\fP with the socket address *this is bound to use. The argument type Wy_SockAddr is protocol interface for the real socket address type WySockAddrLocal, or WySockAddrINet4, etc..PP [\fBRet\fP] Ok Succeed. \fIaddr\fP is set with the address of *this. Wym_EBADF Object is not valid for the operation Wym_EAFNOSUPPORT Invalid address family Wym_EPROTOTYPE Protocol wrong type for socket Wym_ENOTSOCK Object is not a socket Wym_ENOBUFS No buffer space available ... reply converted from the errno that ::getsockname returned.PP [\fBRefer\fP] ::getsockname(int,struct sockaddr*,socklen_t*).\"--------------------------------------------.PP.BI "WyRet peername(Wy_SockAddr& " "addr" ") const".PP Reset \fIaddr\fP with the socket address of the connected peer. The argument type Wy_SockAddr is protocol interface for the real socket address type WySockAddrLocal, or WySockAddrINet4, etc.,.PP [\fBRet\fP] Ok Succeed. \fIaddr\fP is set with the address of the connected peer. Wym_EBADF Object is not valid for the operation Wym_EAFNOSUPPORT Invalid address family Wym_EPROTOTYPE Protocol wrong type for socket Wym_ENOTSOCK Object is not a socket Wym_ENOBUFS No buffer space available Wym_ENOTCONN The socket is not connected ... reply converted from the errno that ::getpeername returned.PP [\fBRefer\fP] ::getpeername(int,struct sockaddr*,socklen_t*).\"--------------------------------------------.PP.BI "virtual WyRet shutdown(int " "how" ")" .PP Shutdown part of the full-duplex connection. \fIhow\fP = SHUT_RD Reception is disallowed. = SHUT_WR Transmission is disallowed. = SHUT_RDWR Reception and transmission are disallowed. Note: shutdown all connections will not make object default..PP [\fBRet\fP] Ok Succeed. Wym_EBADF Object is not valid for the operation Wym_ENOTSOCK Object is not a socket Wym_ENOTCONN Transport endpoint is not connected ....PP [\fBRefer\fP] ::shutdown(int,int).\"--------------------------------------------.PP.BI "virtual WyRet bind(const Wy_SockAddr& " "addr" ")" .PP Bind the *this to the address \fIaddr\fP. The argument type Wy_SockAddr is protocol interface for the real socket address type WySockAddrLocal, or WySockAddrINet4, etc.,.PP [\fBRet\fP] Ok Succeed. Wym_EBADF Object is not valid for the operation Wym_EAFNOSUPPORT Invalid address family Wym_EPROTOTYPE Protocol wrong type for socket Wym_ENOTSOCK Object is not a socket Wym_EACCES Search permission is denied Wym_ENAMETOOLONG Pathname too long Wym_ENOENT Pathname does not exist Wym_EROFS Read-only file system Wym_ENOMEM Not enough memory Wym_ENOTDIR A component in pathname is not a directory Wym_ELOOP Too many symbolic links encountered ... (may be more).PP [\fBRefer\fP] ::bind(int,struct sockaddr*,socklen_t).\"--------------------------------------------.PP.BI "virtual WyRet listen(int " "backlog" ")" .PP Set *this to listen for connection.PP [\fBRet\fP] Ok Succeed. Wym_EBADF Object is not valid for the operation Wym_EADDRINUSE Address already in use Wym_ENOTSOCK Object is not a socket Wym_EOPNOTSUPP Operation not supported ... reply converted from the errno that ::listen returned.PP [\fBRefer\fP] ::listen(int,int).\"--------------------------------------------.PP.BI "virtual WyRet accept(WySockFile& " "skt" ", Wy_SockAddr& " "addr" ")" .PP Accept an arriving connection and reset \fIskt\fP to communicate with it. \fIaddr\fP is reset with the connecting address. The argument type Wy_SockAddr is protocol interface for the real socket address type WySockAddrLocal, or WySockAddrINet4, etc.,.PP Note: This function is for stream type socket. .PP [\fBRet\fP] Ok \fIskt\fP and \fIaddr\fP are setup with the accepted socket and address of the connecting peer. Wym_EINVAL Device is not listening Wym_EAFNOSUPPORT Invalid address family Wym_EPROTOTYPE Protocol wrong type for socket Wym_EAGAIN Non-blocking I/O Wym_EWOULDBLOCK Non-blocking I/O Wym_EBADF Object is not valid for the operation Wym_ENOTSOCK Object is not a socket Wym_EOPNOTSUPP Operation not supported Wym_EINTR Interrupted by a signal Wym_ECONNABORTED Software caused connection abort Wym_EMFILE Too many open fd Wym_ENFILE File table overflow Wym_ENOMEM Not enough memory Wym_ENOBUF Insufficient resource for the operation Wym_EPROTO Protocol error Wym_EPERM Firewall forbid connection (see man.) ...... (maybe more) Note: \fIaddr\fP is set to default if failed..PP [\fBRefer\fP] ::accept(int,struct sockaddr*,socklen_t).\"--------------------------------------------.PP.BI "virtual WyRet connect(const Wy_SockAddr& " "peer_addr" ")".PP Connect to the peer at address \fIpeer_addr\fP. The argument type Wy_SockAddr is protocol interface for the real socket address type WySockAddrLocal, or WySockAddrINet4, etc.,.PP [\fBRet\fP] Ok Succeed. Wym_EBADF Object is not valid for the operation Wym_EPROTOTYPE Protocol wrong type for socket Wym_ENOTSOCK Object is not a socket Wym_EISCONN Transport endpoint is already connected Wym_ECONNREFUSED Connection refused Wym_ETIMEDOUT Timeout for the connection Wym_ENETUNREACH Network is unreachable Wym_EINPROGRESS Operation in progress (non-blocking) Wym_EALREADY Operation already in progress (non-block) Wym_EAGAIN No more local ports or other resources Wym_EAFNOSUPPORT Invalid address family Wym_EACCES Permission denied Wym_EPERM Operation not permitted ... reply converted from the errno that ::connect returned.PP [\fBRefer\fP] ::connect(int,struct sockaddr,socklen_t).\"--------------------------------------------.PP.BI "virtual WyRet sendto(const void* " "buf" ", size_t " "count" ", int " "flags" ", const Wy_SockAddr* " "to" ", size_t& " "n_sent" ")".PP Send \fIcount\fP bytes pointed by \fIbuf\fP via *this associated device to the peer socket at address \fIto\fP. The number of sent bytes is always stored into \fIn_sent\fP \fIflags\fP is a bitwise inclusive OR'd value the same as for ::sendto(..), see associated manual. If \fIto\fP is NULL, function behaves the same as ::send(..).PP [\fBRet\fP] Ok Succeed Wym_EBADF Object is not valid for the operation Wym_ENOTSOCK Socket operation on non-socket Wym_EFAULT \fIbuf\fP is inaccessible Wym_EMSGSIZE Message too long Wym_EAGAIN Non-blocking I/O (write would block) Wym_EINTR Interrupted by a signal before data written Wym_ENOBUFS No buffer space available Wym_EINVAL Invalid argument Wym_ENOMEM Not enough memory Wym_EPIPE Write to a pipe or FIFO with no reader.PP [\fBRefer\fP] ::sendto(int,const void*,size_t,int, const struct sockaddr*,socklen_t).\"--------------------------------------------.PP.BI "virtual WyRet recvfrom(void* " "buf" ", size_t " "count" ", int " "flags" ", Wy_SockAddr* " "from" ", size_t& " "n_recv" ")".PP Receive data from a socket and store into the \fIcount\fP bytes buffer pointed by \fIbuf\fP If \fIfrom\fP is not NULL, *\fIfrom\fP is reset to the peer address that data is received from. \fIflags\fP is a bitwise inclusive OR'd value the same as for ::recvfrom(..), see associated manual. \fIn_recv\fP is always set to the number of bytes written into \fIbuf\fP The receiving data may be sent as a single datagram..PP [\fBRet\fP] Ok Succeed Wym_EBADF Object is not valid for the operation Wym_ENOTSOCK Socket operation on non-socket Wym_ECONNREFUSED Connection refused Wym_ENOTCONN The socket is not connected Wym_EAGAIN Non-blocking I/O (write would block) Wym_EINTR Interrupted by a signal before data written Wym_EFAULT \fIbuf\fP is inaccessible Wym_EINVAL Invalid argument.PP [\fBRefer\fP] ::recvfrom(int,void*,size_t,int, struct sockaddr*,socklen_t*).\"--------------------------------------------.PP.BI "static WyRet sockpair(int " "domain" ", int " "type" ", int " "protocol" ", WySockFile& " "s1" ", WySockFile& " "s2" ")".PP Create an unnamed pipe for the given sockets \fIs1\fP and \fIs2\fP by resetting and connecting the pair of sockets by the arguments specified parameters \fIdomain\fP, \fItype\fP and \fIprotocol\fP. \fIdomain\fP= PF_LOCAL ... \fItype\fP = SOCK_STREAM| SOCK_DGRAM| ... \fIproto\fP = protocol number of the socket (See /etc/protocols) Note: Function may be supported only for \fIdomain\fP=PF_LOCAL..PP [\fBRet\fP] Ok Succeed Wym_EINVAL \fIs1\fP, \fIs2\fP refer to the same object Wym_EMFILE Too many open file descriptors Wym_EAFNOSUPPORT Address family not supported by protocol Wym_EPROTONOSUPPORT protocol is not supported Wym_EOPNOTSUPP Operation not supported.PP [\fBRefer\fP] ::socketpair(int,int,int,int[2]).\"--------------------------------------------.SH "SEE ALSO".BR wysockaddrlocal.BR wysockaddrinet4.BR wysockaddrinet6.BR wyregfile.BR wyfifofile.SH NOTEExcept added by this library, replys are converted from the errno an underlying C library function returned. Report of such replysare brief from Linux Programmer's Manual. See the associated man pagefor details.Project is in development, http://sourceforge.net/projects/libwx
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -