48 #define epicsExportSharedSymbols 74 while( (pciu = pnextciu) ) {
78 if (delay > timeout) {
96 if(delay>maxdelay) maxdelay = delay;
103 epicsPrintf (
"CAS: %d CA channels have expired after %f sec\n",
122 struct sockaddr_in new_recv_addr;
125 SOCKET recv_sock, reply_sock;
128 recv_addr_size =
sizeof(new_recv_addr);
130 reply_sock = conf->
udp;
149 recv_sock = conf->
udp;
172 (
struct sockaddr *)&new_recv_addr,
178 sockErrBuf,
sizeof ( sockErrBuf ) );
196 client->
recv.
cnt = (unsigned) status;
209 status = memcmp(&client->
addr,
210 &new_recv_addr, recv_addr_size);
216 client->
addr = new_recv_addr;
220 client->
addr = new_recv_addr;
227 errlogPrintf (
"CAS: cast server msg of %d bytes from addr %s\n",
242 epicsPrintf (
"CAS: partial (damaged?) UDP msg of %d bytes from %s ?\n",
247 epicsPrintf (
"CAS: message received at %s\n", buf);
255 epicsPrintf (
"CAS: invalid (damaged?) UDP request from %s ?\n", buf);
259 epicsPrintf (
"CAS: message received at %s\n", buf);
277 errlogPrintf (
"CA cast server: Unable to fetch N characters pending\n");
279 clean_addrq (client);
281 else if (nchars == 0) {
283 clean_addrq (client);
LIBCOM_API void epicsStdCall epicsSocketDestroy(SOCKET s)
epicsTimeStamp time_at_creation
void casAttachThreadToClient(struct client *pClient)
struct message_buffer recv
int rsrv_version_reply(struct client *client)
#define ellCount(PLIST)
Report the number of nodes in a list.
Routines to get and set EPICS environment parameters.
void cast_server(void *pParm)
#define CA_UKN_MINOR_VERSION
#define errMessage(S, PM)
void epicsStdCall epicsMutexUnlock(epicsMutexId pmutexNode)
Release the semaphore.
Miscellaneous macro definitions.
void epicsSocketConvertErrnoToString(char *pBuf, unsigned bufSize)
void destroy_client(struct client *client)
#define socket_ioctl(A, B, C)
LIBCOM_API size_t epicsStdCall epicsTimeToStrftime(char *pBuff, size_t bufLength, const char *pFormat, const epicsTimeStamp *pTS)
Convert epicsTimeStamp to string. See epicsTime::strftime()
epicsMutexId chanListLock
#define epicsEventSignal(ID)
A synonym for epicsEventTrigger().
struct message_buffer send
epicsTimeStamp time_at_last_recv
APIs for the epicsMutex mutual exclusion semaphore.
LIBCOM_API void epicsStdCall freeListFree(void *pvt, void *pmem)
int epicsStdCall epicsTimeGetCurrent(epicsTimeStamp *pDest)
Get current time into *pDest.
LIBCOM_API int epicsStdCall bucketRemoveItemUnsignedId(BUCKET *prb, const unsigned *pId)
Remove an item identified by a string from the table.
int camessage(struct client *client)
GLBLTYPE BUCKET * pCaBucket
int errlogPrintf(const char *pFormat,...)
struct client * create_client(SOCKET sock, int proto)
GLBLTYPE epicsEventId casudp_startStopEvent
GLBLTYPE void * rsrvChanFreeList
struct ELLNODE * next
Pointer to next node in list.
GLBLTYPE epicsUInt32 * casIgnoreAddrs
EPICS time stamp, for use from C code.
LIBCOM_API void epicsStdCall epicsThreadSleep(double seconds)
Block the calling thread for at least the specified time.
void cas_send_dg_msg(struct client *pclient)
LIBCOM_API double epicsStdCall epicsTimeDiffInSeconds(const epicsTimeStamp *pLeft, const epicsTimeStamp *pRight)
Time difference between left and right in seconds.
unsigned minor_version_number
EPICS time-stamps (epicsTimeStamp), epicsTime C++ class and C functions for handling wall-clock times...
#define epicsMutexMustLock(ID)
Claim a semaphore (see epicsMutexLock()).
void ellDelete(ELLLIST *pList, ELLNODE *pNode)
Deletes a node from a list.
ELLNODE node
Pointers to the first and last nodes on list.
GLBLTYPE unsigned rsrvChannelCount
GLBLTYPE enum ctl casudp_ctl
unsigned epicsStdCall ipAddrToDottedIP(const struct sockaddr_in *paddr, char *pBuf, unsigned bufSize)