Extracts the first connection on the queue of pending connections and creates a new socket with the same properties as the receiver. If the listen queue has no connection requests the current process will block until a connection is present, or if the receiver is non blocking, it will return an EWOULDBLOCK error code.
If possible, an accept on a blocking socket will block the current Smalltalk process. (If the current process is in a callback, an EACCES error is returned.) A blocking accept in the context of the UI Process is not recommended as it will disable the User Interface for the duration of the blocking call.
See accept: for the use of the optional parameter aSocketAddress. accept will not solicit the address of the connecting socket at acceptance time. However, you can send getPeerName to obtain the address later.
The new socket cannot accept more connections. However, the receiver remains open and can accept more connections.
If the accept operation is unsucessful, it will return an error if one or more of the following is true: ENOTINITIALISED, ENETDOWN, EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EINPROGRESS, EINTR, EINVAL, EMFILE, ENOBUFS, EACCES. For detailed information on these errors, see Error values.
The parameter aSocketAddress is a new instance of SciSocketAddress. If an accept is successful aSocketAddress will then contain the address of the connecting socket. If you want a nil aSocketAddress, then use accept.
Extracts the first connection on the queue of pending connections and creates a new socket with the same properties as the receiver. If the listen queue has no connection the current process will block until a connection is present, or if the receiver is non blocking, it returns an EWOULDBLOCK error code.
If possible, an accept: on a blocking socket will block the current Smalltalk process. (If the current process is in a callback, an EACCES error is returned.) A blocking accept in the context of the UI Process is not recommended as it will disable the User Interface for the duration of the blocking call.
The new socket cannot accept more connections. The receiver remains open and can accept more connections.
If the accept: operation is unsucessful, it will return an error if one or more of the following is true: ENOTINITIALISED, ENETDOWN, EBADF, ENOTSOCK, EOPNOTSUPP, EWOULDBLOCK, EINPROGRESS, EINTR, EINVAL, EMFILE, ENOBUFS, EACCES. For detailed information on these errors, see Error values.
The parameter aSocketAddress contains a valid address, port and family.
If any of the following are true, the bind: aSocketAddress operation returns an error: ENOTINITIALISED, ENETDOWN, EBADF, ENOTSOCK, EAFNOSUPPORT, EADDRNOTAVAIL, EADDRINUSE, EINVAL, ENOBUFS, EACCES. For detailed information on these errors, see Error values.
Closes and releases the socket. The actual close is affected by the socket options SOLINGER and SODONTLINGER. If SOLINGER has a timeout interval, then a hard or abortive close is performed even if queued data is unsent or unacknowledged. If SOLINGER is non-zero on a blocking socket, this operation blocks the current process until the remaining data is sent or the timeout expires. If the socket is set to non-blocking an error EWOULDBLOCK is returned.
If SODONTLINGER is set on a stream socket, the operation will return immediately but data queued for transmission will still be sent. Note that this will delay releasing the socket and the socket being available for an arbitrary period.
If possible, a close on a blocking socket will block the current Smalltalk process. (If the current process is in a callback, an EACCES error is returned.) A blocking close in the context of the UI Process is not recommended as it will disable the User Interface for the duration of the blocking call.
If any of the following occurs, the close operation returns an error: ENOTINITIALISED, ENETDOWN, EBADF, ENOTSOCK, EINTR, EINPRORESS, EWOULDBLOCK, EACCES. For detailed information on these errors, see Error values.
Creates a connection between the receiver and the socket with socket address aSocketAddress. Both sockets must use the same address format and protocol. If a socket is unbound the system automatically binds the socket.
If the receiver is blocking, the operation may block at the current Smalltalk process level until the connection is completed. If the receiver is non-blocking, the error code EWOULDBLOCK may be returned.
If possible, a connect on a blocking socket will block the current Smalltalk process. (If the current process is in a callback, an EACCES error is returned.) A blocking connect in the context of the UI Process is not recommended as it will disable the User Interface for the duration of the blocking call.
If the receiver is a SOCKDGRAM, the connect operation establishes the peer address. The peer address identifies the socket where all datagrams are sent on subsequent sends.
If the initiating socket is SOCKSTREAM, the connect operation attempts to make a connection to the socket specified by the parameter aSocketAddress.
If any of the following occurs, the connect: aSocketAddress operation returns an error: ENOTINITIALISED, ENETDOWN, EBADF, ENOTSOCK, EADDRNOTAVAIL, EDESTADDREQ, EAFNOSUPPORT, ENETDOWN, EISCONN, ETIMEDOUT, ECONNREFUSED, ENETUNREACH, EADDRINUSE, ENOBUFS, EMFILE, EINPRORESS, EINVAL, EINTR, EWOULDBLOCK, EACCES. For detailed information on these errors, see Error values.
The ioctl: operation performs a variety of control operations on the receiver.
The ioctl: operation is unsucessful if any of the following errors occur: ENOTINITIALISED, ENETDOWN, EBADF, EINTR, EINVAL, ENOTSOCK, EINPROGRESS.. For detailed information on these errors, see Error values.
The listen operation performs the following:
The listen: backLog operation is unsucessful if any of the following errors occur: ENOTINITIALISED, ENETDOWN, EADDRINUSE, EINVAL, EISCONN, EMFILE, ENOBUFS, EINPROGRESS, EBADF, ENOTSOCK, EOPNOTSUPP, ECONNREFUSED.. For detailed information on these errors, see Error values.
The recv operation receives data from a connected socket.
The recv operation returns the length of the data received. If a data is too long to fit in the supplied buffer, excess bytes may be truncated if the receiver is a datagram socket.
If no data is available at the socket, the recv operation blocks the current process while waiting for data to arrive, unless the socket is non blocking. If a socket is non blocking, the operation returns an error (EWOULDBLOCK).
If possible, a recv on a blocking socket will block the current Smalltalk process. (If the current process is in a callback, an EACCES error is returned.) A blocking recv in the context of the UI Process is not recommended as it will disable the User Interface for the duration of the blocking call.
If the socket is of type SOCKSTREAM and the remote side has shut down the connection gracefully, the recv operation completes with 0 bytes received.
The recv: aBuffer length: length startingAt: index flags: flags operation is unsucessful if any of the following errors occur: ENOTINITIALISED, ENETDOWN, ENOTCONN, EINPROGRESS, EOPNOTSUPP, ESHUTDOWN, EBADF, ENOTSOCK, EWOULDBLOCK, EMSGSIZE, EINVAL, ECONNABORTED, ECONNRESET, EINTR, EACCES. For detailed information on these errors, see Error values.
The recvAll operation receives data from a connected socket. If multiple receives are required to receive the length, the message will be broken into message segments and received. The recvAll operation will block at the current Smalltalk process level until the operation is completed or returns with an error code. A recvAll in the context of the UI Process is not recommended as it will disable the User Interface for the duration of the blocking call.
The recvAll operation returns a 0 if successfully received length bytes or returns a SciError.
If the socket is of type SOCKSTREAM and the remote side has shut down the connection gracefully, the recvAll operation completes with 0 bytes received.
The recvAll: aBuffer length: length startingAt: index flags: flags operation is unsucessful if any of the following errors occur: ENOTINITIALISED, ENETDOWN, ENOTCONN, EINPROGRESS, EOPNOTSUPP, ESHUTDOWN, EBADF, ENOTSOCK, EWOULDBLOCK, EMSGSIZE, EINVAL, ECONNABORTED, ECONNRESET, EINTR, EACCES. For detailed information on these errors, see Error values.
The recvFrom operation allows an application to receive data from connected and unconnected sockets. The recvFrom operation specifies the source of the data to be received allowing the data to be received from unconnected sockets.
If no data is available at the socket, the recvFrom operation blocks the current process while waiting for data to arrive, unless the socket is non blocking. If a socket is non blocking, the operation returns an error (EWOULDBLOCK).
If possible, a recvFrom on a blocking socket will block the current Smalltalk process. (If the current process is in a callback, an EACCES error is returned.) A blocking recvFrom in the context of the UI Process is not recommended as it will disable the User Interface for the duration of the blocking call.
The recvFrom operation returns the length of the received data. For a datagram socket, if data is too long to fit in the supplied buffer, excess bytes may be truncated depending on the type of socket, and an error code is returned.
The recvFrom: aBuffer length: length startingAt: index flags: flags from: aSocketAddress operation is unsucessful if any of the following errors occur: ENOTINITIALISED, ENETDOWN, ENOTCONN, EINPROGRESS, EOPNOTSUPP, ESHUTDOWN, ENOTSOCK, EWOULDBLOCK, EMSGSIZE, EINVAL, ECONNABORTED, ECONNRESET, EINTR, EBADF, EACCES. For detailed information on these errors, see Error values.
This operation sends data only when the socket is connected. The sendTo: operation can be used with unconnected or connected sockets.
Specify the length of the data with the length parameter. If the receiver is a datagram socket and the data is too long to pass through the underlying protocol, the system returns an error and does not transmit the data. If the receiver is a stream socket, the receiver answers the number of transmitted bytes.
If no buffer space is available within the transport system, the send operation blocks the current process while waiting for buffer space, unless the socket is non blocking. If a socket is non blocking, the operation returns an error (EWOULDBLOCK).
If possible, a send on a blocking socket will block the current Smalltalk process. (i.e., If the current process is in a callback, an EACCES error is returned.) A blocking send in the context of the UI Process is not recommended as it will disable the User Interface for the duration of the blocking call.
The send: aBuffer length: length startingAt: index flags: flags operation is unsucessful if any of the following errors occur: ENOTINITIALISED, ENETDOWN, ENETRESET, ENOTCONN, ENOBUFS, EINPROGRESS, EOPNOTSUPP, ESHUTDOWN, EBADF, ENOTSOCK, EWOULDBLOCK, EMSGSIZE, EINVAL, ECONNABORTED, ECONNRESET, EINTR, EACCES. For detailed information on these errors, see Error values.
This operation sends length bytes of data from aBuffer starting at index. If multiple sends are required the message will be broken into message segments and sent. The sendAll: operation will block at the current Smalltalk process level until the operation is completed or returns with an error code. A sendAll: in the context of the UI Process is not recommended as it will disable the User Interface for the duration of the blocking call.
The socket must be a connected socket. The sendTo: operation must be used with unconnected sockets.
The parameter is a byte array containing the data to be sent.
The sendAll: aBuffer length: length startingAt: index flags: flags operation is unsucessful if any of the following errors occur: ENOTINITIALISED, ENETDOWN, ENETRESET, ENOTCONN, ENOBUFS, EINPROGRESS, EOPNOTSUPP, ESHUTDOWN, EBADF, ENOTSOCK, EWOULDBLOCK, EINVAL, ECONNABORTED, ECONNRESET, EINTR, EACCES. For detailed information on these errors, see Error values.
The sendTo operation allows an application program to send messages through an unconnected socket by specifying a destination aSocketAddress. For stream sockets the aSocketAddress parameter is ignored.
Specify the length of the data with the length parameter. If the receiver is a datagram socket and the data is too long to pass through the underlying protocol, the system returns an error and does not transmit the data. If the receiver is a stream socket, the receiver answers the number of transmitted bytes.
If no buffer space is available within the transport system, the sendTo operation blocks the current process while waiting for buffer space (the blocking occurs at the current Smalltalk process level), unless the socket is non blocking. If a socket is non blocking, the operation returns an error (EWOULDBLOCK).
If possible, a sendTo on a blocking socket will block the current Smalltalk process. (If the current process is in a callback, an EACCES error is returned.) A blocking sendTo in the context of the UI Process is not recommended as it will disable the User Interface for the duration of the blocking call.
To broadcast on a socket, first issue a setSockOpt operation using the SOBROADCAST option to gain broadcast permissions. (Broadcast only on datagram sockets.)
The sendTo: aBuffer length: length startingAt: index flags: flags to: aSocketAddress operation is unsucessful if any of the following errors occur: ENOTINITIALISED, ENETDOWN, ENETRESET, ENOTCONN, ENOBUFS, EINPROGRESS, EOPNOTSUPP, EAFNOSUPPORT, ESHUTDOWN, EBADF, ENOTSOCK, EWOULDBLOCK, EMSGSIZE, EINVAL, ECONNABORTED, ECONNRESET, EINTR, EADDRNOTAVAIL, EDESTADDREQ, ENETUNREACH, EACCES. For detailed information on these errors, see Error values.
The shutDown: mode operation is unsucessful if any of the following errors occur: ENOTINITIALISED, ENETDOWN, EINVAL, EINPROGRESS, ENOTCONN, EBADF, ENOTSOCK. For detailed information on these errors, see Error values.