caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alexsandro Soares <a_s_soares@yahoo.com.br>
To: caml-list@inria.fr
Subject: UDP client
Date: Thu, 29 Mar 2007 19:23:59 -0700 (PDT)	[thread overview]
Message-ID: <641576.48378.qm@web51609.mail.re2.yahoo.com> (raw)

Hi all,

  I'm working in an UDP client, but I can't figure out how to get the same behaviour, in OCaml, such as the C code below:

-----------------------------------------------------------------------------------------------

  sigset_t sigmask;

  sigemptyset(&sigmask);
  sigaddset(&sigmask, SIGIO);      
  sigprocmask(SIG_BLOCK, &sigmask, NULL);
  
  /*
   *  Open UDP socket.
   */
  if( (sockfd = socket(AF_INET, SOCK_DGRAM, 0)) < 0){
    return sock ;      /* Can't open socket. */
  }
  
  if (fcntl(sockfd, F_SETOWN, getpid()) == -1) return sock;

  val = fcntl(sockfd, F_GETFL, 0) ;

  val |= O_NONBLOCK ;
  val |= FASYNC;
  fcntl(sockfd, F_SETFL, val) ;

------------------------------------------------------------------------------------

Could anyone help me?

Thanks,

Alex




__________________________________________________
Fale com seus amigos  de graça com o novo Yahoo! Messenger 
http://br.messenger.yahoo.com/


             reply	other threads:[~2007-03-30  2:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-30  2:23 Alexsandro Soares [this message]
2007-03-30 11:28 ` [Caml-list] " Gerd Stolpmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=641576.48378.qm@web51609.mail.re2.yahoo.com \
    --to=a_s_soares@yahoo.com.br \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).