xenomai.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Per Oberg <pero@wolfram.com>
To: xenomai@lists.linux.dev
Subject: accept after select for RTNet/TCP
Date: Wed, 27 Sep 2023 10:13:53 -0500 (CDT)	[thread overview]
Message-ID: <1477790382.2402907.1695827633513.JavaMail.zimbra@wolfram.com> (raw)

Hi 

I'm currently porting parts of an application that uses some TCP during startup to Xenomai. I have a working example of a TCP server but i cannot make the "select" part work.

If I do 

fd = __COBALT(accept(list_fd, (struct sockaddr *) &client_addr, &client_len)))

without the select part it works. If I do a select before it returns  "Invalid argument". 

The "select" part:
------------------------------------
fd_set in_fds;
FD_ZERO(&in_fds);
FD_SET(list_fd, &in_fds);
int selRet = __COBALT(select(list_fd + 1, &in_fds, 0, 0, 0));
(FD_ISSET(list_fd, &in_fds))
{
  printf("list_fd (%i)  is in FDSET\n", list_fd);
}
------------------------------------

The program works when compiled for regular linux.
Is select for TCP RTNet a no no ?


Best Regards
Per Öberg 


             reply	other threads:[~2023-09-27 15:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-27 15:13 Per Oberg [this message]
2023-09-27 20:21 ` accept after select for RTNet/TCP Florian Bezdeka
2023-09-28  5:54   ` Per Oberg
2023-09-28 11:17     ` Per Oberg
2023-09-29 10:41       ` Florian Bezdeka
2023-09-29 12:11         ` Jan Kiszka
2023-09-30 12:42         ` Per Oberg
2023-10-05  8:07           ` Florian Bezdeka

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=1477790382.2402907.1695827633513.JavaMail.zimbra@wolfram.com \
    --to=pero@wolfram.com \
    --cc=xenomai@lists.linux.dev \
    /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 read-only IMAP folder(s) and NNTP newsgroup(s).