posix-select Questions

3

Solved

In C pseudo-code: while (1) { fifo = open("fifo", O_RDONLY | O_NONBLOCK); fd_set read; FD_SET(fifo, &read); select(nfds, &read, NULL, NULL, NULL); } The process sleeps as triggered b...
Anapest asked 30/1, 2013 at 0:11

7

Solved

First, a little background to explain the motivation: I'm working on a very simple select()-based TCP "mirror proxy", that allows two firewalled clients to talk to each other indirectly. Both clien...
Predial asked 17/7, 2013 at 16:24

8

Solved

I'm wondering if there's an easy way to iterate through a fd_set? The reason I want to do this is to not having to loop through all connected sockets, since select() alters these fd_sets to only in...
Chance asked 7/9, 2010 at 17:56

4

Solved

I have a worker thread that is listening to a TCP socket for incoming traffic, and buffering the received data for the main thread to access (let's call this socket A). However, the worker thread a...
Boyle asked 21/12, 2008 at 12:23

2

I looked at the differences between poll, epoll and select. What I don't understand is when should I use select. I don't see any advantage, given that poll and epoll have everything that select has...
Sacttler asked 2/8, 2013 at 15:33

1

Solved

Similar to the problem asked a while ago on kernel 3.x, but I'm seeing it on 4.9.37. The named fifo is created with mkfifo -m 0666. On the read side it is opened with int fd = open(FIFO_NAME, O_...
Pinson asked 25/8, 2018 at 9:3

2

Solved

The POSIX pselect function take a signal mask argument. The signal mask is "atomically" set as the current mask before execution of the function begins, and is restored as the function returns. Th...
Proposition asked 31/1, 2018 at 11:43

1

Solved

My end goal is to distinguish between my pressing Esc (ASCII 27) on my keyboard, and me pressing the → key on my keyboard (which translates to a sequence of 27 91 67). I am using termios to pu...
Nyaya asked 31/12, 2017 at 3:33

3

Solved

Unix/C question here. I have multiple sockets that I am trying to poll for periodic data. I don't want select to wait indefinitely so I have a timeout in place and I'm running in a loop. I have fou...
Angadresma asked 5/3, 2012 at 21:10

4

Solved

select() is a great system call. You can pack any number of file descriptors, socket descriptors, pipes, etc. and get notified in a synchronous fashion when input becomes available. Is there a way...
Fennell asked 24/2, 2010 at 17:38

1

select on fds higher then 255 do not check if the fd is open. Here is my example code: #include <stdio.h> #include <errno.h> #include <unistd.h> #include <sys/select.h> in...
Kaiserdom asked 3/11, 2017 at 14:27

4

Let's say I start a thread to receive on a port. The socket call will block on recvfrom. Then, somehow in another thread, I close the socket. On Windows, this will unblock recvfrom and my thread e...
Poky asked 17/6, 2011 at 18:12

3

Solved

$ python Python 2.7.5 (default, Aug 25 2013, 00:04:04) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin Type "help", "copyright", "credits" or "license" for more information. >&...
Californium asked 2/11, 2013 at 9:11

3

Solved

I am trying to use the select function to have non-blocking i/o between a server and 1 client (no more) where the communication flows nicely (can send at any time and the other will receive without...
Silverstein asked 16/7, 2011 at 6:17

2

Solved

I'm trying to wrap my head around calling select on sockets and I can't understand what I'm doing wrong. setup_server_socket calls bind and listen and sets the socket to nonblocking mode. The fol...
Gibby asked 22/9, 2015 at 8:2

2

Solved

I'm having a little trouble with sockets, when looping I'm not receiving data except for the first loop, it's timing out each time. If I close and reopen the socket each loop though I seem to be ge...
Legionnaire asked 17/9, 2014 at 11:6

2

Solved

I wanted to test inotify, so took a couple of examples from internet, modified it to learn various aspects, but failed as it didn't work like i wanted to. First i tried to watch over a directory wh...
Heterochromous asked 4/7, 2014 at 13:42

1

Coming from a linux background, I'm used to the concept that everything is a file, i.e. sockets AND stdin. This makes it easy to write a simple server/client using select(), where I include ...
Jactitation asked 22/4, 2014 at 14:18

3

I'm designing a C program in linux where I'll have two threads. One main thread is the event_processor_thread which does the main function processing. Second thread is an event_dispatcher thread ru...
Bean asked 19/11, 2013 at 12:41

1

Solved

I am writing a network communication program using non-blocking sockets (C/C++) and select. The program is pretty big, so I cannot upload source code. In a very aggressive testing session, I ...
Upswell asked 2/11, 2013 at 2:21

3

I've seen a few write-ups comparing select() with poll() or epoll(), and I've seen many guides discussing the actual usage of select() with multiple sockets. However, what I can't seem to find is ...
Rensselaerite asked 3/10, 2013 at 21:16

3

[I asked something similar before. This is a more focused version.] What can cause a server's select() call on a TCP socket to consistently time-out rather than "see" the client's close() of the s...
Transient asked 7/3, 2013 at 18:42

2

I am new to sockets programming and I'm trying to thoroughly understand how it works, but for now I'm really stuck on select(). The problem is that in my code, after select detects activity and the...
Befuddle asked 23/1, 2013 at 17:17

2

Solved

I created a simple application to accept IPv4 TCP connections using select() and accept(). I use a python script to test this. It opens 100 connection in sequence. ie: for i in range(100): s = s...
Crittenden asked 8/8, 2012 at 2:9

2

Solved

In linux. I want to build an autoclicker that will have an enable/disable function when a key is pressed. Obviously there should be 2 things running in parallel (the clicker itself, and the enable...
Bank asked 6/5, 2012 at 21:25

© 2022 - 2025 — McMap. All rights reserved.