If an object was attempted to have been connected in the
background, this is a placeholder for that
ongoing connection.
-connectNetObjectInBackground:toHost:onPort:withTimeout:
will return an instance of this object. This placeholder object can be used to cancel an ongoing connection with the -abortConnection
method.
TCPPort is a class that is used to bind a descriptor
to a certain TCP/IP port and listen for connections. When
a connection is received, it will create a class set with
-setNetObject:
and set it up with the new connection. When the TCPPort
is dealloc'd it will close the descriptor if it had not
been closed already.
Initializes a port on aHost and
binds it to port aPort. If
aHost is nil, it will set it
up on all addresses on the local machine. Using zero for
aPort will use a random currently
available port number. Use
-port
to find out where it is actually bound to.
Sets the class that will be initialized if a
connection occurs on this port. If
aClass does not implement the
<NetObject>
protocol, will throw a FatalNetException.
Will connect the object netObject to host
aHost on port aPort. If this
connection doesn't happen in aTimeout
seconds or some other error occurs, it will return
nil and the error string and error
number shall be set accordingly. Otherwise this will
return netObject
Connects netObject to host
aHost on the port aPort.
Returns a place holder object that finishes the
connection in the background. The placeholder
will fail if the connection does not occur in
aTimeout seconds. Returns nil
if an error occurs and sets the error string and error
number accordingly.
Returns the errno of the last error that occurred.
If it is some other non-system error, this will be zero,
but the error string shall be set accordingly.
Returns a host order 32-bit integer from a host
Returns YES on success and
NO on failure, the result is stored in
the 32-bit integer pointed to by aNumber
Returns a network order 32-bit integer from a host
Returns YES on success and
NO on failure, the result is stored in
the 32-bit integer pointed to by aNumber
Handles the actual reading of data from the
connection. Throws an exception if an error
occurs while reading data. The @"Data" key in the
userInfo for these exceptions should be any NSData
that could not be returned. If maxDataSize
is <= 0, all possible data will be read.
If aData is nil, this will
physically transport the data to the connected
end. Otherwise this will put the data in the buffer of
data that needs to be written to the connection when
next possible.
A class can implement this protocol, and when it is
connected in the background using
-connectNetObjectInBackground:toHost:onPort:withTimeout:
it will receive the messages in this protocol which notify the object of certain events while being connected in the background.
Could be the current error string if the error number
is zero and some error has occurred. Indicates that a
NSHost returned an address that was invalid.