CORDET Framework - C2 Implementation
|
Implementation of Socket-Based OutStream. More...
Go to the source code of this file.
Functions | |
static void * | acceptThreadEntry (void *ptr) |
Entry point for the thread which waits for the incoming connection from the InStream. More... | |
void | CrFwOutStreamSocketInitAction (FwPrDesc_t prDesc) |
Initialization action for the socket-based OutStream. More... | |
void | CrFwOutStreamSocketShutdownAction (FwSmDesc_t smDesc) |
Shutdown action for the socket-based OutStream. More... | |
CrFwBool_t | CrFwOutStreamSocketPcktHandover (CrFwPckt_t pckt) |
Function implementing the hand-over operation for the socket-based OutStream. More... | |
void | CrFwOutStreamSocketInitCheck (FwPrDesc_t prDesc) |
Initialization check for the socket-based OutStream. More... | |
void | CrFwOutStreamSocketConfigCheck (FwPrDesc_t prDesc) |
Configuration check for the socket-based OutStream. More... | |
void | CrFwOutStreamSocketSetPort (unsigned short n) |
Set the port number for the socket. More... | |
Variables | |
static unsigned short | portno = 0 |
Set the port number (must be same as the port number specified in CrFwOutStreamSocket.c | |
static int | sockfd |
The file descriptors for the socket. | |
static int | newsockfd |
The file descriptors for the socket. | |
static struct sockaddr_in | cli_addr |
Socket variable. | |
static socklen_t | clilen |
Socket variable. | |
Implementation of Socket-Based OutStream.
This file is part of the CORDET Framework.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
For information on alternative licensing, please contact P&P Software GmbH.
Definition in file CrFwOutStreamSocket.c.
|
static |
Entry point for the thread which waits for the incoming connection from the InStream.
ptr | unused argument (required with compatibility with pthread create function) |
Definition at line 143 of file CrFwOutStreamSocket.c.
void CrFwOutStreamSocketConfigCheck | ( | FwPrDesc_t | prDesc | ) |
Configuration check for the socket-based OutStream.
The check is successful if the connection from the matching InStream has been successfully accepted.
prDesc | the initialization procedure descriptor. |
Definition at line 167 of file CrFwOutStreamSocket.c.
void CrFwOutStreamSocketInitAction | ( | FwPrDesc_t | prDesc | ) |
Initialization action for the socket-based OutStream.
This action:
CrFwOutStreamDefInitAction
)The function sets the outcome to "success" if all these operations are successful.
prDesc | the initialization procedure descriptor. |
Definition at line 75 of file CrFwOutStreamSocket.c.
void CrFwOutStreamSocketInitCheck | ( | FwPrDesc_t | prDesc | ) |
Initialization check for the socket-based OutStream.
The check is successful if the port number has been set to a value larger than 2000.
prDesc | the initialization procedure descriptor. |
Definition at line 155 of file CrFwOutStreamSocket.c.
CrFwBool_t CrFwOutStreamSocketPcktHandover | ( | CrFwPckt_t | pckt | ) |
Function implementing the hand-over operation for the socket-based OutStream.
This function performs a non-blocking write on the socket and, if it succeeds, it returns 1; otherwise, it returns 0.
pckt | the packet to be written to the socket |
Definition at line 125 of file CrFwOutStreamSocket.c.
void CrFwOutStreamSocketSetPort | ( | unsigned short | n | ) |
Set the port number for the socket.
The port number must be an integer greater than 2000.
n | the port number. |
Definition at line 179 of file CrFwOutStreamSocket.c.
void CrFwOutStreamSocketShutdownAction | ( | FwSmDesc_t | smDesc | ) |
Shutdown action for the socket-based OutStream.
This action executes the Shutdown Action of the base OutStream (function CrFwOutStreamDefShutdownAction
) and then closes the socket.
smDesc | the OutStream State Machine descriptor (this parameter is not used). |
Definition at line 118 of file CrFwOutStreamSocket.c.