Questions tagged [setsockopt]
142 questions
2
votes
1 answer
How to disable the timeout setsockopt() has set?
In the program I am developing, I've set a timeout using setsockopt() in order to prevent recvfrom() from blocking indefinitely. How can I disable the timeout?
(I'm on Ubuntu)

Rapidturtle
- 217
- 1
- 3
- 13
2
votes
2 answers
Local socket option set vs pointer to socket option set
I wonder... what is the actual difference if you create a function that has a simple socket parameter and you do your basic instructions inside that function like setting different option to that socket (setsockopt()) and after the functions exist…
user3368555
2
votes
0 answers
Transparent stunnel proxy setsockopt Operation not permitted
I am attempting to run a transparent stunnel4 proxy on a server for a websocket service.
The WS server is based on the Ratchet framework and thus does not support WSS, hence the need for a proxy.
When transparent is set to none in the stunnel.conf…

Jonny K
- 31
- 1
- 7
2
votes
1 answer
getsockopt on OSX returns incorrect value?
I am using following program to debug a larger issue.
Now if I run same program on OSX, getopt never returns me 0 or 1, it always returns whatever value for optval I have set!!
There must be something obviously wrong in my program that is escaping…

Subodh Nijsure
- 3,305
- 5
- 26
- 45
2
votes
1 answer
Set connect timout using setsockopt in Linux
I am writing a linux Qt5/c++ app that tries to connect to a peer using a QTcpSocket. I call
tcpsocket->connectToHost(address,port,options)
When the peer is available it works great and connects immediately. However, when the peer is not…

TSG
- 4,242
- 9
- 61
- 121
2
votes
1 answer
ZeroMQ, XSUB does not receive
I have implemented one publisher and one subscriber network using ZeroMQ. I used XPUB and XSUB, because I want the subscriber be able to send data to publisher as well. My code works for XPUB + SUB, meaning subscriber can receive data from…

Max Li
- 551
- 2
- 14
2
votes
1 answer
When the new value specified for SO_RCVBUF in setsockopt() will take effect?
My query is related to “SO_RCVBUF” option in setsocketopt() api.
When the new value specified for SO_RCVBUF in setsockopt() will take effect?
I am testing the flow control of TCP/IP and below is my environment.
The client program is a slow reader…

user3581289
- 21
- 3
2
votes
0 answers
Socket option SO_RCVTIMEO inaccurate?
I use hiredis redisSetTimeout function set timeout 10ms, when i start 100 thread it is accurate 10ms, but when i start 1000 thread, some call in redisVCommand cost 300+ms, and not timeout, can anyone explain this in detail?
redisSetTimeout function…

good90
- 41
- 2
- 7
2
votes
1 answer
Attaching filter to raw sockets in Linux
That question is the next step of this.
I changed my code to use AF_PACKET socket, but this time, my application needs to deal with lots of traffic. I decided to use LSF filter in order to decrease the workload of my application.
Here is my new…

Ramazan
- 989
- 3
- 14
- 26
2
votes
1 answer
SO_BINDTODEVICE Failing for virtual interface
I am trying to run PTPDV2 (precision timing protocol) server which binds on interface for setting up multicasting.
I have a following virtual interface
eth1:0 Link encap:Ethernet HWaddr 00:00:50:A0:42:BD
inet addr:10.2.0.17 …

rajshenoy
- 501
- 1
- 7
- 16
2
votes
1 answer
increase tcp receive window on linux
Similar to Setting TCP receive window in C and working with tcpdump in Linux and Why changing value of SO_RCVBUF doesn't work?, I'm a unable to increase the initial tcp receive window greater than 5888 on ubuntu linux…

Collin Anderson
- 14,787
- 6
- 68
- 57
2
votes
2 answers
Replaying http traffic with original source address
I want to build a testbed including a client and a web server, where I can replay some logged http get requests to the web server. So I am planning to exactly simulating the actual traffic with requests with their original source address and port…

Amir
- 5,996
- 13
- 48
- 61
2
votes
0 answers
IP_MULTICAST_TTL and windows7
My application is creating an UDP socket and setting some options. One of the option is IP_MULTICAST_TTL.
When the application is running on windows 7, and I observe the traffic on the wire with wireshark, I can see that the TTL is always 1, meaning…

magopieri
- 80
- 8
2
votes
1 answer
Similar function to GetLastError in objective-C/C?
I'm doing some lovely socket programming in objective-C right now and part of my code is giving me an error (in the setsockopt method call). I was wondering if anyone knows of a similar function to the GetLastError() function in C++ that I could use…

Josh Bradley
- 4,630
- 13
- 54
- 79
2
votes
1 answer
How to Properly Set up a UDP Socket using UDP_CORK
I have created an echo server under UDP, and am working on a client that splits up a given file into packets and transfers it to a server, which then returns the packets to be reassembled by the client.
Sending the individual packets works just…

Cody
- 135
- 1
- 3
- 11