[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc

Title:DECC
Notice:General DEC C discussions
Moderator:TLE::D_SMITHNTE
Created:Fri Nov 13 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2212
Total number of notes:11045

2097.0. "How to use socket in real-time C" by VAXRIO::CONT_RENATO (R.Mendes@CIMsolutions Brasil) Tue Feb 18 1997 15:10

Hi,

   I have a request to write a code that uses sockets, but the program, due
   to its nature (real time process control), can never stop. I'm using VMS AXP.
   Looking at the socket library, I found the recv() function, that
   would make me read the socket data. It can be blocking or not.

   If it's not blocking, I would have to use an internal timer
   to keep checking for more data to arrive, using the select() function. 
   If it's blocking, my code would hang until more data arrives.
  
   Is there around another way of doing it, so that there would be a
   socket read request and, once it gets its data, it calls me a handler
   or an VMS AST ? What about threads implementation. Would that solve my
   problem (but I would have to install a new product, right) ? Also, 
   may I use send() while a blocking recv() is posted in the socket ?

   Thanks in advance for any help and my best regards.
  
   Renato Mendes
T.RTitleUserPersonal
Name
DateLines
2097.1See UCX DocumentationXDELTA::HOFFMANSteve, OpenVMS EngineeringWed Feb 19 1997 10:0114
   The socket library is part of DIGITAL TCP/IP Services (UCX), and is
   not directly part of DEC C.  (This is the wrong notes conference for
   socket questions.)

   If performing process control, I'd look at performing $qio[w] calls
   to BGDRIVER -- the UCX IP device driver -- and I'd stay well clear
   of the socket library.  (The UNIX socket library does not have a
   concept such as an AST, and tends to require synchronous operations
   or polling.  Use of the OpenVMS AST mechanism often provides a rather
   better solution.)

   The BGDRIVER interface is documented in the UCX documentation.

2097.2Don't use socketsGYPSC1::BRAEUMon Mar 03 1997 09:009
    I would keep away from sockets in any case - the only way to find out
    about broken connections is the condition_value field of the
    io_status_block when you use $QIO[W].
    
    Be shure to look into UCX$EXAMPLES: - there are some things not
    mentioned in the documentation which you can find in the examples
    (especially when using the AUX server).
    
    		Walter