Questions tagged [posix-select]

22 questions
0
votes
0 answers

Why doesn't pselect adjust the timeout argument?

The manual page for select/pselect [1] along with this LWN article [2] explicitly mention that calls to the library function pselect will not modify the timeout argument whereas the select call might, depending on the implementation. The LWN article…
Huckle
  • 1,810
  • 3
  • 26
  • 40
0
votes
1 answer

pselect() with accept() in a loop

I have a multi-threaded server, which spawns new threads with these loop: while(handle->m_run) { if (handle->m_curThreadCount < handle->m_maxThreads) { ready = pselect(socket + 1, &readSocket, NULL, NULL, &timeout, NULL); if (ready…
Vlad Fedyaev
  • 105
  • 1
  • 9
0
votes
1 answer

STDIN prevents activating of other file descriptors

The following program is written to receive clients' messages and read user inputs from keyboard: FD_ZERO(&masterfds); FD_SET(udp_con, &masterfds); FD_SET(0, &masterfds); maxfds = udp_con; while(exit == false) { FD_ZERO(&readfds); readfds =…
Amir
  • 10,600
  • 9
  • 48
  • 75
0
votes
1 answer

Detecting the timed out client in select function

I want to use the select function to work with different file descriptors. When the program starts, it must start sending packets to other clients in accordance to an interval. My first question is how can I employ a timer in the main while loop…
Amir
  • 10,600
  • 9
  • 48
  • 75
0
votes
2 answers

Alternatives to select() on client side

Is there an alternative to select() for the client side of a TCP non-blocking socket connection? select() is mainly for multiple connections, but my client only has a single connection. As a result, I asked myself if there is an alternative function…
Genius
  • 569
  • 1
  • 3
  • 23
0
votes
1 answer

Am experiencing issues with select()

After many tries I couldn't get my select() work. I'm so lost! I'm gettin -1 as a result. I'm following this guide. listen(sock, MAXQUEUE); build_select_list(sock, connectlist, highsock, socks); readsocks = select(FD_SETSIZE, &socks, (fd_set *) 0,…
Luke SpringWalker
  • 1,600
  • 3
  • 19
  • 33
-2
votes
1 answer

Host and client aren't able to communicate in my chat program, using select()

I am attempting to write a simple chat program where one user can connect to a host. The two should be able to talk to each other (they might interrupt each other but that is ok). I am having difficulties with select(). Here is the…
Andrew Kind
  • 111
  • 1
  • 1
  • 9
1
2