PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBSockPort
Wrapper Class for the ISockPort interface.
#include <SFBSockPort.h.hpp>
class SFBSockPort : public SFBPort;
<link linkend="sec.macro.core.typedef.SFMTYPEDEFWRAPPER">SFMTYPEDEFWRAPPER</link>(SFBSockPort)
        

Inheritance diagram

 Inheritance diagram of SFBSockPortClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
X X O O

Reference

BREW API ISockPort

Member

Public Functions
SFCError Accept( SFBSockPortSmpPtr sockport )
The accept function is used on listening sockets to respond when AEE_NET_READ_EVENT is asserted.
SFCError Bind( VoidConstPtr addr )
This function associates a local address and port with the socket. The bind function is used on an unconnected socket.
SFCError Connect( VoidConstPtr addr )
For sockets of type AEE_SOCKPORT_STREAM, this attempts to initiate a TCP connection to the specified remote address.
Void DbgMark( Void )
Make the debug mark.
SFCError GetOpt( SInt32 level , SInt32 name , VoidPtr value , SInt32Ptr size )
Gets options for a socket.
SFCError GetOpt( SInt32 level , SInt32 name , SFXBufferPtr value )
Gets options for a socket.
SFCError GetPeerName( VoidPtr addr , SInt32Ptr size )
This function returns the remote address of the connected socket.
SFCError GetPeerName( SFXBufferPtr buffer )
This function returns the remote address of the connected socket.
SFCError GetSDBAckInfo( AEESDBAckInfo * info )
Get the information regarding the last SDB acknowledgment that arrived for this socket.
SFCError GetSockName( VoidPtr addr , SInt32Ptr size )
This function returns the local address of the socket.
SFCError GetSockName( SFXBufferPtr buffer )
This function returns the local address of the socket.
SFCError IsRealized( BoolPtr realized )
Check if the socket is realized (bound).
SFCError Listen( SInt32 backlog )
Performs a passive open for connections, such that incoming connections may be subsequently accepted.
static
SFBSockPortSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBSockPort instance.
static
SFBSockPortSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBSockPort instance.
SFCError OpenEx( UInt16 family , AEESockType type , SInt32 protocol )
Opens a SockPort for use with a specific address family, type and protocol.
SInt32 ReadV( SockIOBlock * ioblocks , UInt16 count )
This function reads data from a socket. It reads data into one or more buffers described by the entries in the iov[] array.
SFCError Realize( Void )
Acquire an IP address and ensures that the underlying network layer is ready for communication.
SInt32 RecvFrom( ACharPtr buffer , SInt32 length , UInt32 flags , VoidPtr addr , SInt32Ptr size )
This functions reads data from datagram socket and records the address of the sender.
SInt32 RecvFrom( SFXBufferPtr buffer , UInt32 flags , VoidPtr addr , SInt32Ptr size )
This functions reads data from datagram socket and records the address of the sender.
SFCError RecvMsg( AEESockMsgHdr * header , UInt32 flags )
Read data from a datagram socket and records the address of the sender, similarly to RecvFrom().
SFCError SelectNetwork( SInt32 network )
This function selects a specific data network.
SFCError SelectNetworkEx( SInt32 network , SInt16 family )
Select a specific data network.
SInt32 SendTo( ACharConstPtr buffer , SInt32 length , UInt32 flags , VoidConstPtr addr )
This function sends a datagram packet to the specified address from the local address bound to the socket.
SInt32 SendTo( SFXAnsiStringConstRef buffer , UInt32 flags , VoidConstPtr addr )
This function sends a datagram packet to the specified address from the local address bound to the socket.
SInt32 SendTo( SFXBufferConstRef buffer , UInt32 flags , VoidConstPtr addr )
This function sends a datagram packet to the specified address from the local address bound to the socket.
SFCError SetOpt( SInt32 level , SInt32 name , VoidConstPtr value , SInt32 size )
Sets options for a socket.
SFCError SetOpt( SInt32 level , SInt32 name , SFXBufferConstRef value )
Sets options for a socket.
SFCError Shutdown( SInt32 how )
Causes all or part of a full-duplex connection to be terminated gracefully.
SInt32 WriteV( SockIOBlock const * ioblocks , UInt16 count )
This function writes data to a connected socket.
SFCError Close( Void ) (inherits from SFBPort)
Close an opened port or stops a open in progress.
static
Bool
Exhausted( SInt32 code ) (inherits from SFBSource)
Determine if a SFBSource, a SFBPeek, or a SFBGetLine is out of data.
SFCError GetLastError( Void ) (inherits from SFBPort)
Return the last error that occurred with the SFBPort.
SFCError IOCtl( SInt32 option , UInt32 val ) (inherits from SFBPort)
Allow some control over the behaviour of an SFBPort.
SFCError Open( ACharConstPtr port ) (inherits from SFBPort)
Open the specified prt.
SFCError Open( SFXAnsiStringConstRef port ) (inherits from SFBPort)
Open the specified prt.
SFCError QueryInterface( AEECLSID clsid , VoidHandle handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFCError QueryInterface( AEECLSID clsid , SFBBaseSmpPtr handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFBBaseSmp QueryInterface( AEECLSID clsid ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SInt32 Read( VoidPtr buf , SInt32 size ) (inherits from SFBSource)
Copy bytes from the source stream to the specified buffer.
SInt32 Read( SFXBufferPtr buf ) (inherits from SFBSource)
Copy bytes from the source stream to the specified buffer.
Void Readable( SFXCallbackPtr callback ) (inherits from SFBSource)
Schedule a callback to be called when SFBSource::Read() is able to return something other than ISOURCE_WAIT.
Void Self( AEECLSID clsidReq , SFBQuerySmpPtr clone , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
SFBQuerySmp Self( AEECLSID clsidReq , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
SInt32 Write( ACharConstPtr port , SInt32 bufSize ) (inherits from SFBPort)
Copy bytes from the specified buffer to the source stream.
SInt32 Write( SFXAnsiStringConstRef buf ) (inherits from SFBPort)
Copy bytes from the specified buffer to the source stream.
SInt32 Write( SFXBufferConstRef buf ) (inherits from SFBPort)
Copy bytes from the specified buffer to the source stream.
Void Writeable( SFXCallbackPtr callback ) (inherits from SFBPort)
Schedule a function to be called when SFBPort::Write() would return something other than AEEPORT_WAIT.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBSockPort::Accept
The accept function is used on listening sockets to respond when AEE_NET_READ_EVENT is asserted.
[ public ]
SFCError Accept(
    SFBSockPortSmpPtr sockport   // Pointer to the newly accepted SFBSockPort interface 
);

Return value

  • AEE_NET_EBADF : socket is not open
  • AEE_NET_EFAULT : invalid pps pointer
  • AEE_NET_EINVAL : socket is not listening
  • AEE_NET_EOPNOTSUPP : The socket is not of type SOCK_STREAM
  • AEE_NET_ENETNONET : network subsystem unavailable for some unknown reason
  • AEE_NET_ENETINPROGRESS : network subsystem establishment currently in progress
  • AEE_NET_ENETCLOSEINPROGRESS: network subsystem close in progress.
  • AEE_NET_ENOMEM : not enough memory to establish connection.
  • AEE_NET_EMFILE : Not enough resources to complete this operation (too many sockets in use)

Other error codes are also possible.

Description

Note that the IPORT_WAIT return value is used instead of an error return value and an AEE_NET_EWOULDBLOCK error code.

Reference

BREW API ISockPort_Accept


SFBSockPort::Bind
This function associates a local address and port with the socket. The bind function is used on an unconnected socket.
[ public ]
SFCError Bind(
    VoidConstPtr addr   // an opaque pointer to the address to bind to (see AEESockAddrStorage)
);

Return value

  • AEE_NET_SUCCESS : socket has been successfully bound to the local address
  • IPORT_WAIT : (AEE_AF_INET and AEE_AF_INET6 only) The operation cannot be completed at present. This can occur when a network connection is being established (see ISockPort_Writeable()).
  • AEE_NET_EBADF : socket is not open
  • AEE_NET_EAFNOSUPPORT: not an inet address
  • AEE_NET_EMFILE : Not enough resources to complete this operation (too many sockets in use)
  • AEE_NET_ENETDOWN : Network layer failed; handset has lost network coverage
  • AEE_NET_EOPNOTSUPP : specific local IP address was requested (not supported)
  • AEE_NET_EADDRINUSE : the local address is already in use
  • AEE_NET_EINVAL : socket is already bound to a local address
  • AEE_NET_EFAULT : invalid address parameter has been specified

Other error codes are also possible.

Description

Note that the IPORT_WAIT return value is used instead of an error return value and an AEE_NET_EWOULDBLOCK error code.

Binding to a specific local IP address is not currently supported.

Reference

BREW API ISockPort_Bind


SFBSockPort::Connect
For sockets of type AEE_SOCKPORT_STREAM, this attempts to initiate a TCP connection to the specified remote address.
[ public ]
SFCError Connect(
    VoidConstPtr addr   // an opaque pointer to the address to connect to (see AEESockAddrStorage)
);

Return value

  • AEE_NET_SUCCESS: socket has been successfully connected to the remote address
  • IPORT_WAIT: (AEE_AF_INET and AEE_AF_INET6 only) The operation cannot be completed at present. This can occur when a network connection is being established (see ISockPort_Writeable()).
  • AEE_NET_EBADF : socket is not open
  • AEE_NET_EAFNOSUPPORT : not an inet address
  • AEE_NET_EMFILE : Not enough resources to complete this operation (too many sockets in use)
  • AEE_NET_ENETDOWN : Network layer failed; handset has lost network coverage
  • AEE_NET_ECONNREFUSED : connection attempt refused
  • AEE_NET_ETIMEDOUT : connection attempt timed out
  • AEE_NET_EFAULT : invalid address parameter has been specified
  • AEE_NET_EOPNOTSUPP : invalid server address specified, or not a stream socket
  • AEE_NET_EISCONN : socket is already connected
  • AEE_NET_ENOMEM : not enough memory to establish connection.
  • AEE_NET_EIPADDRCHANGED: IP address changed due to PPP resync
  • AEE_NET_EINPROGRESS : connection establishment in progress
  • AEE_NET_ENETDOWN : network subsystem unavailable

Other error codes are also possible.

Description

Note that the IPORT_WAIT return value is used instead of an error return value and an AEE_NET_EWOULDBLOCK error code.

ISockPort_Connect() with DGRAM sockets is not supported.

Reference

BREW API ISockPort_Connect


SFBSockPort::DbgMark
Make the debug mark.
[ public ]
Void DbgMark(Void);

SFBSockPort::GetOpt
Gets options for a socket.
[ public ]
SFCError GetOpt(
    SInt32 level     // option level (see AEESockOpt) 
    SInt32 name      // option name (see AEESockOpt) 
    VoidPtr value    // pointer to the data type appropriate for the option (see AEESockOpt) 
    SInt32Ptr size   // on input, pnOptSize specifies the size of pOptVal in bytes. On output, pnOptSize is set to the number of data bytes filled into value. 
);
[ public ]
SFCError GetOpt(
    SInt32 level         // option level (see AEESockOpt) 
    SInt32 name          // option name (see AEESockOpt) 
    SFXBufferPtr value   // pointer to the data type appropriate for the option (see AEESockOpt) 
);

Return value

  • AEE_NET_SUCCESS: The socket option has been successfully retrieved.
  • IPORT_WAIT: Operation in progress; use ISockPort_Readable() to be notified when to try again.
  • AEE_NET_EFAULT : invalid parameter has been specified
  • AEE_NET_EINVAL : invalid socket
  • AEE_NET_EBADF : socket is not open
  • AEE_NET_ENOPROTOOPT: the option is unknown at the level indicated
  • AEE_NET_EOPNOTSUPP : not supported on this socket type
  • AEE_NET_ENETDOWN : Network layer failed; handset has lost network coverage
  • AEE_NET_EMFILE : not enough resources to complete this operation (too many sockets are in use).

Other error codes are also possible.

Reference

BREW API ISockPort_GetOpt


SFBSockPort::GetPeerName
This function returns the remote address of the connected socket.
[ public ]
SFCError GetPeerName(
    VoidPtr addr     // an opaque pointer to the address to be filled in (see AEESockAddrStorage) 
    SInt32Ptr size   // a pointer to the size of the address
);
[ public ]
SFCError GetPeerName(
    SFXBufferPtr buffer   // a pointer to the address to be filled in
);

Return value

  • AEE_NET_SUCCESS: pAddr has been successfully filled in with the remote address
  • AEE_NET_EBADF : socket is not open
  • AEE_NET_EOPNOTSUPP: The socket is not of type SOCK_STREAM
  • AEE_NET_EINVAL : not a stream socket
  • AEE_NET_ENOTCONN : socket is not connected
  • AEE_NET_ECONNRESET: remote connection has been closed
  • AEE_NET_EFAULT : invalid address parameter has been specified

Other error codes are also possible.

Reference

BREW API ISockPort_GetPeerName


SFBSockPort::GetSDBAckInfo
Get the information regarding the last SDB acknowledgment that arrived for this socket.
[ public ]
SFCError GetSDBAckInfo(
    AEESDBAckInfo * info   // User-allocated struct for the retrieved information.
);

Version

Introduced BREW Client 3.1.5 SP01 or 4.0.2

Reference

BREW API ISockPort_GetSDBAckInfo


SFBSockPort::GetSockName
This function returns the local address of the socket.
[ public ]
SFCError GetSockName(
    VoidPtr addr     // an opaque pointer to the address to be filled in (see AEESockAddrStorage) 
    SInt32Ptr size   // a pointer to the size of the address. 
);
[ public ]
SFCError GetSockName(
    SFXBufferPtr buffer   // a pointer to the address to be filled in
);

Return value

  • AEE_NET_SUCCESS: pAddr has been successfully filled in with the local address
  • AEE_NET_EBADF : socket is not open
  • AEE_NET_EINVAL: socket is not bound to a local address
  • AEE_NET_EFAULT: invalid address parameter has been specified

Other error codes are also possible.

Reference

BREW API ISockPort_GetSockName


SFBSockPort::IsRealized
Check if the socket is realized (bound).
[ public ]
SFCError IsRealized(
    BoolPtr realized   // pointer to a Bool value; set to true or false according to the socket's status.
);

Version

Introduced BREW Client 3.1.5 SP01

Reference

BREW API ISockPort_IsRealized


SFBSockPort::Listen
Performs a passive open for connections, such that incoming connections may be subsequently accepted.
[ public ]
SFCError Listen(
    SInt32 backlog   // the maximum number of pending connections 
);

Return value

  • AEE_NET_SUCCESS: socket has been successfully placed into listening mode
  • IPORT_WAIT: (AEE_AF_INET and AEE_AF_INET6 only) The operation cannot be completed at present. This can occur when a network connection is being established (see ISockPort_Writeable()).
  • AEE_NET_EBADF : socket is not open
  • AEE_NET_EOPNOTSUPP : The socket is not capable of listening (UDP)
  • AEE_NET_EFAULT : backlog parameter is invalid
  • AEE_NET_ENETNONET : network subsystem unavailable for some unknown reason
  • AEE_NET_ENETINPROGRESS : network subsystem establishment currently in progress
  • AEE_NET_ENETCLOSEINPROGRESS: network subsystem close in progress.
  • AEE_NET_EINVAL : Socket is not bound, or already listening
  • AEE_NET_EISCONN : socket is connected
  • AEE_NET_ENOMEM : out of memory

Other error codes are also possible.

Reference

BREW API ISockPort_Listen


SFBSockPort::NewInstance
Create a new SFBSockPort instance.
[ public, static ]
SFBSockPortSmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBSockPortSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBSockPort::OpenEx
Opens a SockPort for use with a specific address family, type and protocol.
[ public ]
SFCError OpenEx(
    UInt16 family      // address family (AEE_AF_*). If SFBSockPort::SelectNetwork() or SFBSockPort::SelectNetworkEx() was already called for this socket,family should match the address family that was requested for the network. 

    AEESockType type   // socket type
    SInt32 protocol    // socket protocol (AEE_IPPROTO_*) or 0 to select the system's default for the given wFamily and nType combination
);

Return value

  • AEE_NET_SUCCESS: socket has been successfully opened with the address family, type and protocol requested
  • AEE_NET_EBADF : socket is already open
  • AEE_NET_ESOCKNOSUPPORT : invalid type
  • AEE_NET_EPROTONOSUPPORT: invalid protocol
  • AEE_NET_EAFNOSUPPORT : invalid family
  • AEE_NET_EPROTOTYPE : wrong protocol for socket type
  • AEE_NET_ENOMEM : out of memory
  • AEE_NET_EINVAL : invalid family for this socket

Other error codes are also possible.

Reference

BREW API ISockPort_OpenEx


SFBSockPort::ReadV
This function reads data from a socket. It reads data into one or more buffers described by the entries in the iov[] array.
[ public ]
SInt32 ReadV(
    SockIOBlock * ioblocks   // an array of SockIoBlock structures into which data can be read 
    UInt16 count             // specifies the number of entries in the iov array 
);

Return value

  • bytes_read (>0) : Any positive number indicates the total of all the bytes read into the provided buffers.
  • 0 (zero) : There is no more data to be received; the peer has shut down the connection.
  • IPORT_WAIT : No data available now; try again later. (See ISockPort_Readable())
  • IPORT_ERROR : the specific error code can be retrieved by calling ISockPort_GetLastError():
  • AEE_NET_EBADF : socket is not open
  • AEE_NET_ENOTCONN : socket not connected
  • AEE_NET_ECONNRESET : connection reset by server
  • AEE_NET_ECONNABORTED : connection aborted due to timeout or other failure
  • AEE_NET_EIPADDRCHANGED: IP address changed, causing connection reset
  • AEE_NET_EPIPE : broken pipe
  • AEE_NET_ENETDOWN : network subsystem unavailable
  • AEE_NET_EFAULT : invalid address parameter has been specified
  • AEE_NET_EINVAL : not a stream socket
  • AEE_NET_ESHUTDOWN : socket is shutdown for reading

Other error codes are also possible.

Description

Note that the IPORT_WAIT return value is used instead of an error return value and an AEE_NET_EWOULDBLOCK error code.

Reference

BREW API ISockPort_ReadV


SFBSockPort::Realize
Acquire an IP address and ensures that the underlying network layer is ready for communication.
[ public ]
SFCError Realize(Void);

Version

Introduced BREW Client 3.1.5 SP01

Reference

BREW API ISockPort_Realize


SFBSockPort::RecvFrom
This functions reads data from datagram socket and records the address of the sender.
[ public ]
SInt32 RecvFrom(
    ACharPtr buffer   // buffer to hold the received data 
    SInt32 length     // size of the buffer, in bytes 
    UInt32 flags      // not used 
    VoidPtr addr      // a pointer to the address to be filled in (see AEESockAddrStorage)
    SInt32Ptr size    // a pointer to the size of the address
);
[ public ]
SInt32 RecvFrom(
    SFXBufferPtr buffer   // buffer to hold the received data 
    UInt32 flags          // not used 
    VoidPtr addr          // a pointer to the address to be filled in (see AEESockAddrStorage)
    SInt32Ptr size        // a pointer to the size of the address
);

Return value

  • bytes_read (>=0) : any non-negative number indicates a number of bytes that have been successfully read into the provided buffer
  • IPORT_WAIT : No data available now; try again later. (See ISockPort_Readable())
  • IPORT_ERROR : the specific error code can be retrieved by calling ISockPort_GetLastError():
  • AEE_NET_EBADF : socket is not open
  • AEE_NET_EMFILE : not enough resources to complete this operation (too many sockets are in use).
  • AEE_NET_ENETDOWN : network is not available (e.g. handset is outside of coverage area)
  • AEE_NET_EOPNOTSUPP: not a datagram socket
  • AEE_NET_EADDRINUSE: attempted to bind to local port already in use
  • AEE_NET_EFAULT : invalid pcBuf pointer
  • AEE_NET_EINVAL : socket not bound

Other error codes are also possible.

Description

Note that the IPORT_WAIT return value is used instead of an error return value and an AEE_NET_EWOULDBLOCK error code.

Reference

BREW API ISockPort_RecvFrom


SFBSockPort::RecvMsg
Read data from a datagram socket and records the address of the sender, similarly to RecvFrom().
[ public ]
SFCError RecvMsg(
    AEESockMsgHdr * header   // pointer to AEESockMsgHdr, used to pack parameters
    UInt32 flags             // currently, only the SOCKPORT_FLAG_RECVMSG_ERRQUEUE flag is supported
);

Version

Introduced BREW Client 3.1.5 SP01 or 4.0.2

Reference

BREW API ISockPort_RecvMsg


SFBSockPort::SelectNetwork
This function selects a specific data network.
[ public ]
SFCError SelectNetwork(
    SInt32 network   // data network type (AEE_NETWORK_*) 
);

Return value

  • AEE_NET_SUCCESS: the data network was selected
  • AEE_NET_EINVAL: the network is not valid
  • AEE_NET_EOPNOTSUPP: the network has already been selected.
  • AEE_EFAILED: other error.

Other error codes are also possible.

Description

Most applications will not need to explicitly select the network.

Reference

BREW API ISockPort_SelectNetwork


SFBSockPort::SelectNetworkEx
Select a specific data network.
[ public ]
SFCError SelectNetworkEx(
    SInt32 network   // data network type (AEE_NETWORK_*) 
    SInt16 family    // network address family (AEE_AF_*). If SFBSockPort_OpenEx() was already called for this socket, family should match the address family that was requested for the socket. 
);

Return value

  • AEE_NET_SUCCESS: the data network was selected
  • AEE_NET_EINVAL: the network is not valid
  • AEE_NET_EOPNOTSUPP: the network has already been selected.
  • AEE_EFAILED: other error.

Other error codes are also possible.

Description

This function deprecates SFBSockPort::SelectNetwork().

Version

Introduced BREW Client 3.1.4

Reference

BREW API ISockPort_SelectNetworkEx


SFBSockPort::SendTo
This function sends a datagram packet to the specified address from the local address bound to the socket.
[ public ]
SInt32 SendTo(
    ACharConstPtr buffer   // buffer of data to send 
    SInt32 length          // size of the buffer, in bytes 
    UInt32 flags           // Data transport options
    VoidConstPtr addr      // an opaque pointer to the address to send to (see AEESockAddrStorage)
);
[ public ]
SInt32 SendTo(
    SFXAnsiStringConstRef buffer   // buffer of data to send 
    UInt32 flags                   // Data transport options
    VoidConstPtr addr              // an opaque pointer to the address to send to (see AEESockAddrStorage)
);
[ public ]
SInt32 SendTo(
    SFXBufferConstRef buffer   // buffer of data to send 
    UInt32 flags               // Data transport options
    VoidConstPtr addr          // an opaque pointer to the address to send to (see AEESockAddrStorage)
);

Return value

  • bytes_sent (>0) : any positive number indicates the number of bytes successfully sent.
  • IPORT_WAIT : Cannot send data at this time; try again later. (See ISockPort_Writeable())
  • IPORT_ERROR : the specific error code can be retrieved by calling ISockPort_GetLastError():
  • AEE_NET_EBADF : socket is not open
  • AEE_NET_EAFNOSUPPORT: not an inet address
  • AEE_NET_EMFILE : not enough resources to complete this operation (too many sockets are in use).
  • AEE_NET_ENETDOWN : network is not available (e.g. handset is outside of coverage area)
  • AEE_NET_EOPNOTSUPP : not a datagram socket
  • AEE_NET_EFAULT : invalid pcBuf pointer
  • AEE_NET_ENOMEM : not enough memory
  • AEE_NET_EINVAL : socket not bound
  • EPRIVLEVEL : no privileges to use URGENT or WAKEUP flags

Other error codes are also possible.

Description

Note that the IPORT_WAIT return value is used instead of an error return value and an AEE_NET_EWOULDBLOCK error code.

Reference

BREW API ISockPort_SendTo


SFBSockPort::SetOpt
Sets options for a socket.
[ public ]
SFCError SetOpt(
    SInt32 level         // option level (see AEESockOpt)
    SInt32 name          // option name (see AEESockOpt) 
    VoidConstPtr value   // pointer to the data type appropriate for the option (see AEESockOpt)
    SInt32 size          // size of value
);
[ public ]
SFCError SetOpt(
    SInt32 level              // option level (see AEESockOpt)
    SInt32 name               // option name (see AEESockOpt) 
    SFXBufferConstRef value   // pointer to the data type appropriate for the option (see AEESockOpt)
);

Return value

  • The socket option has been successfully set.
  • IPORT_WAIT: Operation in progress; use ISockPort_Writeable() to be notified when to try again.
  • AEE_NET_EFAULT : invalid parameter has been specified
  • AEE_NET_EINVAL : invalid socket
  • AEE_NET_EBADF : socket is not open
  • AEE_NET_ENOPROTOOPT: the option is unknown at the level indicated
  • AEE_NET_EOPNOTSUPP : not supported on this socket type
  • AEE_NET_ENETDOWN : Network layer failed; handset has lost network coverage
  • AEE_NET_EMFILE : not enough resources to complete this operation (too many sockets are in use).

Other error codes are also possible.

Reference

BREW API ISockPort_SetOpt


SFBSockPort::Shutdown
Causes all or part of a full-duplex connection to be terminated gracefully.
[ public ]
SFCError Shutdown(
    SInt32 how   // Dictates which portion(s) of the connection to shutdown 
);

Return value

  • AEE_NET_SUCCESS: the socket has been successfully shutdown.
  • IPORT_WAIT : (AEE_AF_INET and AEE_AF_INET6 only) unable to shutdown now; try again later (see ISockPort_Writeable()).
  • AEE_NET_EBADF : socket is not open
  • AEE_NET_EOPNOTSUPP : the socket is not of type SOCK_STREAM
  • AEE_NET_EINVAL : unknown nHow parameter
  • AEE_NET_ENOTCONN : socket is not connected
  • AEE_NET_ESHUTDOWN : socket is already shutdown

Other error codes are also possible.

Description

Note that the IPORT_WAIT return value is used instead of an error return value and an AEE_NET_EWOULDBLOCK error code.

Reference

BREW API ISockPort_Shutdown


SFBSockPort::WriteV
This function writes data to a connected socket.
[ public ]
SInt32 WriteV(
    SockIOBlock const * ioblocks   // an array of SockIoBlock structures into which data can be read 
    UInt16 count                   // specifies the number of entries in the iov array 
);

Return value

  • bytes_written (>0): Any positive number indicates the total number of bytes successfully written from all of the iov[] buffers.
  • IPORT_WAIT : No bytes could be written at this time; try again later. (See ISockPort_Writeable())
  • IPORT_ERROR : the specific error code can be retrieved by calling ISockPort_GetLastError():
  • AEE_NET_EBADF : socket is not open
  • AEE_NET_ENOTCONN : socket not connected
  • AEE_NET_ECONNRESET : connection reset by server
  • AEE_NET_ECONNABORTED : connection aborted due to timeout or other failure
  • AEE_NET_EIPADDRCHANGED: address changed, causing connection reset
  • AEE_NET_EPIPE : broken pipe
  • AEE_NET_ENETDOWN : network subsystem unavailable
  • AEE_NET_EFAULT : invalid address parameter has been specified
  • AEE_NET_EINVAL : not a stream socket
  • AEE_NET_ESHUTDOWN : socket is shutdown for writing

Other error codes are also possible.

Description

Note that the IPORT_WAIT return value is used instead of an error return value and an AEE_NET_EWOULDBLOCK error code.

Reference

BREW API ISockPort_WriteV