Topics
:The vbStream class is derived from the vbSocket class and is used to send and receive variable blocks over a TCP connection.
vbStream::vbStream()
vbStream::~vbStream()
vbStream::AddBlock()
vbStream::ChangeBlock()
vbStream::CloseConnection()
vbStream::DeleteBlock()
vbStream::HostName()
vbStream::PortNumber()
vbStream::ReadAckBlock()
vbStream::ReadBlock()
vbStream::ReadClientHeader()
vbStream::ReadHeader()
vbStream::ReadRemoteAckBlock()
vbStream::ReadRemoteBlock()
vbStream::RemoteHostName()
vbStream::RemotePortNumber()
vbStream::RequestBlock()
vbStream::SetBlockStatus()
vbStream::StreamClient()
vbStream::StreamServer()
vbStream::TerminateConnection()
vbStream::WriteAckBlock()
vbStream::WriteBlock()
vbStream::WriteHeader()
vbStream::WriteRemoteAckBlock()
vbStream::WriteRemoteBlock()
int vbStream::AddBlock(const void *block, vbBlockHeader &block_header)
- Public member function used to request that the block pointed to by the "block" variable be added by a local or remote device. The block header must account for the total length of the data pointed to by the "block" variable. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::AddBlock(vbsSocket_t s, const void *block, vbBlockHeader &block_header)
- Public member function used to request that the block pointed to by the "block" variable be added by the specified socket descriptor. The block header must account for the total length of the data pointed to by the "block" variable. Returns zero if no errors occur or a non-zero value to indicate a failure. - Public member function used to request that the block pointed to by the "block" variable be changed by a local or remote device. The "request" variable points to the new information that will be inserted in place of the block pointed to by the "block" variable. The block header must account for the total length of the data pointed to by the "block" variable and the "request_header" must account for the total length of the data pointed to by the "request" variable. Returns zero if no errors occur or a non-zero value to indicate a failure. - Public member function used to request that the block pointed to by the "block" variable be changed by the specified socket descriptor. The "request" variable points to the new information that will be inserted in place of the block pointed to by the "block" variable. The block header must account for the total length of the data pointed to by the "block" variable and the "request_header" must account for the total length of the data pointed to by the "request" variable. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::CloseConnection()
- Public member function that sends a block command used to close a persistent client or server connection. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::CloseConnection(vbsSocket_t s)
- Public member function that sends a block command to the specified socket descriptor used to close a persistent client or server connection. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::DeleteBlock(const void *request, vbBlockHeader &request_header)
- Public member function used to request that the a block pointed to by the "request" variable be deleted. The request_header must account for the total length of the data pointed to by the "request" variable. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::DeleteBlock(vbsSocket_t s, const void *request,vbBlockHeader &request_header)
- Public member function used to request that the a block pointed to by the "request" variable be deleted by the specified socket descriptor. The request_header must account for the total length of the data pointed to by the "request" variable. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::HostName(char *hs)
- Public member function that passes back the host name of this machine in the "hs" variable. NOTE: A memory buffer equal to vbsMAX_NAME_LEN must be pre-allocated prior to using this function. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::PortNumber(int &port)
- Public member function that passes back the port number actually set by the system in the "port" variable. Returns zero if no errors occur or a non-zero value to indicate a failure. - Public member function used to read an acknowledgment block. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::ReadAckBlock(vbsSocket_t s)
- Public member function used to read an acknowledgment block from the specified socket descriptor. Returns zero if no errors occurs or a non-zero value to indicate a failure.int vbStream::ReadBlock(vbsSocket_t s, void *buf, vbBlockHeader &vb)
- Public member function used to read a variable block from the specified socket descriptor. The block header must account for the total length of the data pointed to by the "buf" variable. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::ReadClientHeader(vbBlockHeader &vbs)
- Public member function used to read a client header. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::ReadHeader(vbsSocket_t s, vbBlockHeader &vb)
- Public member function used to read a device block header from the specified socket descriptor. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::ReadRemoteAckBlock()
- Public member function used to read a client acknowledgment block. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::ReadRemoteBlock(void *buf, vbBlockHeader &vb)
- Public member function used to read a remote block. The block header must account for the total length of the data pointed to by the "buf" variable. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::RemoteHostName(char *hs)
- Public member function that passes back the host name of the client in the "hs" variable. NOTE: A memory buffer for "hs" equal to vbsMAX_NAME_LEN must be pre-allocated prior to using this function. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::RemotePortNumber(int &port)
- Public member function that passes back the client's port number in the "port" variable. Returns zero if no errors occur or a non-zero value to indicate a failure. - Public member function used to request a block from the remote end. The "request" variable points to the request information. The request_header must account for the total length of the data pointed to by the "request" variable. Returns the requested block or a null value if an error occurs. The block returned by this function must be typecast to the correct type by the calling function. - Public member function used to request a block from the specified socket descriptor. The "request" variable points to the request information. The request_header must account for the total length of the data pointed to by the "request" variable. Returns the requested block or a null value if an error occurs. The block returned by this function must be typecast to the correct type by the calling function. - Public member function used to set the variable block header status member control byte. NOTE: The block's next deleted variable must be set, if needed, after a call to this function. The block length will not be set here.int vbStream::StreamClient(int port, char *host)
- Public member function used to connect a stream client to the specified host. Returns zero if no errors occur during initialization or a non-zero value to indicate a failure.int vbStream::StreamServer(int port, int max_connections = SOMAXCONN)
- Public member function used to initialize a stream server. Returns zero if no errors occur during initialization or a non-zero value to indicate a failure.int vbStream::TerminateConnection()
- Public member function used to send a block command that will shutdown a server or client. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::TerminateConnection(vbsSocket_t s)
- Public member function used to send a block command to the specified socket descriptor that will shutdown a server or client. Returns zero if no errors occur or a non-zero value to indicate a failure. - Public member function used to write an acknowledgment block. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::WriteAckBlock(vbsSocket_t s)
- Public member function used to write an acknowledgment block to the specified socket descriptor. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::WriteBlock(const void *buf, int bytes)
- Public member function used to write a block of raw data. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::WriteBlock(vbsSocket_t s, const void *buf, int bytes)
- Public member function used to write a block of raw data to the specified socket descriptor. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::WriteBlock(vbsSocket_t s, const void *buf, vbBlockHeader &vb)
-Public member function used to write a variable block to the specified socket descriptor. The block header must account for the total length of the data pointed to by the "buf" variable. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::WriteHeader(vbsSocket_t s, vbBlockHeader &vb)
- Public member function used to write a block header to the specified socket descriptor. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::WriteRemoteAckBlock()
- Public member function used to write an acknowledgment block to the remote end. Returns zero if no errors occur or a non-zero value to indicate a failure.int vbStream::WriteRemoteBlock(void *buf, int bytes)
- Public member function used to write a block of raw data to the remote end. Returns zero if no errors occur or a non-zero value to indicate a failure.
End Of Document |