Questions tagged [setsockopt]
142 questions
1
vote
1 answer
python 3 'MarkerServer' object has no attribute 'setsockopt'
I am having an old python 27 code that I am trying to port to python 35 and was having a doubt on the following part:
class MarkerServer(asyncore.dispatcher):
def __init__(self, queue, proto):
asyncore.dispatcher.__init__(self)
self.queue…

compmonks
- 647
- 10
- 24
1
vote
1 answer
setsockopt SO_BROADCAST on TCP socket
In an existing networking library I've been tasked to work on there is a call to setsockopt which I don't understand
Here you can see a TCP socket begin created:
[socket] fd(11) domain(2:AF_INET) type(1:SOCK_STREAM) protocol(0:default)
Immediately…

Steve Lorimer
- 27,059
- 17
- 118
- 213
1
vote
1 answer
NS3: how to setup RcvBufSize for each TCP session?
I have to run two TCP sessions with different RcvBufSize.
I know the following code can setup the RcvBufSize for all TCP sessions.
Config::SetDefault("ns3::TcpSocket::RcvBufSize", UintegerValue (1500000));
Actually, I'm looking for the function…

wguo
- 55
- 1
- 6
1
vote
1 answer
Using setsockopt() and select() to set UDP timeout
I know both of this can be used to set timeout of recvfrom(), but which one is better? Intuitively, setsockopt seems simple to use, but I found many examples are using select(). I only use a single socket and the timeout is recalculated in…

Rapidturtle
- 217
- 1
- 3
- 13
1
vote
0 answers
Datagram Unix domain socket limited by SNDBUF
Sending 16 byte packets across a Unix datagram domain socket with SNDBUF left at the default on my box of 124928 (verified with getsockopt()). Have also bumped the max_dgram_qlen up to 512. For testing purposes my receiver is currently sleeping…

mr19
- 187
- 1
- 15
1
vote
0 answers
Calling setsockopt many times
I have application which uses sockets to transfer data between two clients. It uses a single socket to communicate control and data traffic (over UDP).
Qos and tos fields of IP header can be changed using
setsockopt(sockfd, IPPROTO_IP, IP_TOS, …

ItsMe
- 373
- 2
- 15
1
vote
1 answer
QDISC_BYPASS in Python (Raw Sockets)
How do I set the socket options on a raw socket to have QDISC_BYPASS enabled? I saw examples in C but wasn't able to understand clearly how to implement it in Python.
I constructed the socket with AF_PACKET and SOCK_RAW settings.
I understand that I…

tt_Gantz
- 2,786
- 3
- 23
- 43
1
vote
1 answer
setsockopt (sys/socket.h)
The prototype for setsockopt is:
int setsockopt(int socket, int level, int option_name, const void *option_value, socklen_t option_len);
Are the following all correct? Which are not?
a.)
int buffsize = 50000;
setsockopt(s, SOL_SOCKET, SO_RCVBUF,…

lojin
- 11
- 1
- 2
1
vote
0 answers
Can SOL_SOCKET be used for any optname?
I am very new to SCTP programming and while troubleshooting and referring to a book (Unix Network Programming, by W.Richard Stevens) I came across something ambiguous. They have used the level name as SOL_SOCKET here and here for option name…

Sukhmeet Singh
- 29
- 1
- 11
1
vote
1 answer
Set Time Out TCP [ setsockopt + SO_RCVTIMEO ]
I want to ask about something when I want to set timeout with specific socket i call this function
void Server::setReceiveTimeout(unsigned int timeout, SOCKET clientSocket)
{
if (setsockopt(clientSocket, SOL_SOCKET, SO_RCVTIMEO, (char*)&timeout,…

Rehab Reda
- 193
- 7
- 16
1
vote
2 answers
What is the setsockopt option name of TCP_USER_TIMEOUT on OSX
I'm trying to port some code over to OSX - it appears that setsockopt has a few differences from Linux. The one I've found and corrected so far is using TCP_KEEPALIVE instead of TCP_KEEPIDLE.
What is the equivalent to TCP_USER_TIMEOUT for…

JuJoDi
- 14,627
- 23
- 80
- 126
1
vote
1 answer
setsockopt returning error 10014
I'm trying to write a simple UDP server that advertises its service port on a multicast group but I'm having trouble getting the multicast to work. I tried looking around on the Microsoft documentation and copy/pasted some of their code but it's not…

jocamar
- 83
- 9
1
vote
0 answers
How to reuseAddress option with socket properly
I am right now debugging my socket application, witch involving running and shutting down it consistently. My problem is when I run and shut it down then run it again I receive 10048 error code, witch indicate address already in use. I tried to set…

SIFE
- 5,567
- 7
- 32
- 46
1
vote
1 answer
Why NO Callback from BeginReceive when I set ReuseAddress to true? UDP
I'm creating a C# socket for UDP receive and send capabilities with Asynchronous callback functions for the receive. Simple, right! It took a while to get all the wrinkles ironed out, but it works... Well, as long as you hog the port! I need to…

Dainon
- 23
- 3
1
vote
2 answers
"setsockopt SO_SNDBUF failed in tcp_connect()"
I have a problem in my C client, where I implemented a client gsoap program to invoke a web service.
Everything works fine on a Windows PC, but when I publish my code on a linux-based POS device, I receive the following error:
"setsockopt SO_SNDBUF…

Rabih harb
- 1,372
- 12
- 11