Back: Sockets.SocketImpl-socket operations Up: Sockets package Forward: Sockets.StreamSocket class-accessing   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document

6.22 Sockets.StreamSocket

Defined in namespace Sockets
Superclass: Sockets.AbstractSocket
Category: Sockets-Streams

This class adds a read buffer to the basic model of AbstractSocket.

6.22.1 Sockets.StreamSocket class: accessing  (class)
6.22.2 Sockets.StreamSocket class: initialize  (class)
6.22.3 Sockets.StreamSocket class: instance creation  (class)
6.22.4 Sockets.StreamSocket: accessing  (instance)
6.22.5 Sockets.StreamSocket: accessing-reading  (instance)
6.22.6 Sockets.StreamSocket: out-of-band data  (instance)
6.22.7 Sockets.StreamSocket: printing  (instance)
6.22.8 Sockets.StreamSocket: stream protocol  (instance)


6.22.1 Sockets.StreamSocket class: accessing

defaultImplementationClassFor: aSocketAddressClass
Answer the default implementation class. Depending on the subclass, this might be the default stream socket implementation class of the given address class, or rather its default datagram socket implementation class.

readBufferSize
Answer the size of the read buffer for newly-created sockets

readBufferSize: anInteger
Set the size of the read buffer for newly-created sockets


6.22.2 Sockets.StreamSocket class: initialize

initialize
Initialize the receiver's defaults


6.22.3 Sockets.StreamSocket class: instance creation

remote: ipAddressOrString port: remotePort
Create a new socket and connect to the given host (passed as a String to be resolved or as a SocketAddress), and to the given port.

remote: ipAddressOrString port: remotePort local: ipAddress port: localPort
Create a new socket and connect to the given host (passed as a String to be resolved or as a SocketAddress), and to the given remotePort. Then bind it to the local address passed in ipAddress, on the localPort port; if the former is nil, any local address will do, and if the latter is 0, any local port will do.


6.22.4 Sockets.StreamSocket: accessing

address
Answer the address of the remote endpoint

port
Answer the port of the remote endpoint


6.22.5 Sockets.StreamSocket: accessing-reading

nextAvailable: anInteger into: aCollection startingAt: pos
Place up to anInteger objects from the receiver into aCollection, starting from position pos and stopping if no more data is available.

nextAvailable: anInteger putAllOn: aStream
Copy up to anInteger objects from the receiver to aStream, stopping if no more data is available.


6.22.6 Sockets.StreamSocket: out-of-band data

outOfBand
Return a datagram socket to be used for receiving out-of-band data on the receiver.


6.22.7 Sockets.StreamSocket: printing

printOn: aStream
Print a representation of the receiver on aStream


6.22.8 Sockets.StreamSocket: stream protocol

atEnd
Answer whether more data is available on the socket

availableBytes
Answer how many bytes are available in the socket's read buffer or from the operating system.

bufferContents
Answer the current contents of the read buffer

canRead
Answer whether more data is available in the socket's read buffer or from the operating system.

close
Flush and close the socket.

fill
Fill the read buffer with data read from the socket

isPeerAlive
Answer whether the connection with the peer remote machine is still valid.

next
Read a byte from the socket. This might yield control to other Smalltalk Processes.

peek
Read a byte from the socket, without advancing the buffer; answer nil if no more data is available. This might yield control to other Smalltalk Processes.

peekFor: anObject
Read a byte from the socket, advancing the buffer only if it matches anObject; answer whether they did match or not. This might yield control to other Smalltalk Processes.

readBufferSize: size
Create a new read buffer of the given size (which is only possible before the first read or if the current buffer is empty).



Back: Sockets.StreamSocket-printing Up: Sockets.StreamSocket Forward: Sockets.TCPSocketImpl   Top: GNU Smalltalk Library Reference Contents: Table of Contents Index: Class index About: About this document


This document was generated on August, 19 2010 using texi2html