Questions tagged [setsockopt]

142 questions
0
votes
0 answers

Is there any limit to TCP receive queue and send queue?

Firstly, I know that we can use setsockopt() to control SNDBUF (I know it is not recommended but I want to know how it works and how bad it is), and this will fix the buffer size to a value we want (The size I set is rightly between the limitaion of…
tyChen
  • 1,404
  • 8
  • 27
0
votes
1 answer

Setsockopt issue with SCTP_PRIMARY_ADDR and SCTP_SET_PEER_PRIMARY_ADDR options

I am trying to use socket options SCTP_PRIMARY_ADDR to make one of local address of SCTP association as primary and SCTP_SET_PEER_PRIMARY_ADDR to request SCTP server to make one of it's address as primary for SCTP future communication. struct…
0
votes
0 answers

setsockopt doesn't work with SO_RCVBUF decreasing and TCP_QUICKACK

I have a simple TCP client-server example. Server just for receiving data. The server side logic is: #define LISTEN_PORT 31337 #define BUFFER_SIZE 4096 //#define QUICKACK void main () { int buflen = 6000, opt_val = 1; int server_fd,…
z0lupka
  • 236
  • 4
  • 19
0
votes
2 answers

How to set TCP keep alive interval for a specific socket fd (Not system wide) in VxWorks?

I created a TCP socket in an application with KEEPALIVE enabled for this socket. I can see that keepalive packets are coming with the frequency of keepalive interval which i have already set in my system variable of iptcp, i.e 30secs. Socket…
Webster
  • 79
  • 8
0
votes
0 answers

C++ Should Any Socket Options Be Set Via setsockopt()? (Simple socket POST request)

Currently in my C++ application I authenticate a client by creating a simple POST request then sending it to my webserver (all data is encrypted during transfer) through the C++ socket then receiving and processing the response. The flow of how I…
Power5
  • 69
  • 1
  • 5
0
votes
0 answers

Error “No such device” in call setsockopt IPV6_ADD_MEMBERSHIP

Related: Error "No such device" in call setsockopt while stracing one of a unit test process (I am not the author of the unit test), I am encountering socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP) = 8 setsockopt(8, SOL_SOCKET, SO_REUSEADDR, [1], 4) =…
ealeon
  • 12,074
  • 24
  • 92
  • 173
0
votes
1 answer

Socket Programming C++ setsockopt()

I am new to socket programming. I am trying to write a basic socket programming program. I looked up the usages of socket(), bind() , setsockopt() functions and the others along with working code samples. In the setsockopt() function , I had used…
Ronit
  • 11
  • 1
  • 1
  • 4
0
votes
3 answers

set socket recv buffer size without chunk

I'm having an issue with Socket in C. Packet size is set to 3072 in sock option like this : int recvBuff = 3072; int recvLowAt = 2; if (setsockopt(sock, SOL_SOCKET, SO_RCVLOWAT, &recvLowAt, sizeof(recvLowAt)) < 0) { LOGE("Error…
X6Entrepreneur
  • 971
  • 2
  • 10
  • 30
0
votes
0 answers

Need to setsockopt at the SOL_SOCKET and IPPROTO_IP levels

So basically I currently have my socket set up with setsockopt(nativeSock, SOL_SOCKET, SO_TIMESTAMPING, &so_timestamping_flags, sizeof(so_timestamping_flags) because I need access to the msghdr for timestamping reasons. However, I also…
notAChance
  • 1,360
  • 4
  • 15
  • 47
0
votes
1 answer

SO_KEEPALIVE: Set on the server socket or on a per-client basis?

I have the following function for configuring TCP Keepalive for a socket: int configure_tcp_keepalive(int fd) { int opt_val = 1; if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, &opt_val, sizeof(opt_val)) == -1) return -1; int…
Hello
  • 113
  • 3
  • 11
0
votes
1 answer

C++ Socket Buffer Size

This is more of a request for confirmation than a question, so I'll keep it brief. (I am away from my PC and so can't simply implement this solution to test). I'm writing a program to send an image file taken via webcam (along with meta data) from a…
Catch_0x16
  • 187
  • 1
  • 4
  • 13
0
votes
1 answer

Setting sockopt for client socket returned from accept()

I'm trying to set socket options for a client socket returned from the accept() function. But they are not getting set correctly. My aim is to time out the client after a particular time of inactivity. But the server should still be able to accept…
3lokh
  • 891
  • 4
  • 17
  • 39
0
votes
0 answers

Version of setsockopt

I need to use the following method to define the receive buffer for specific sockets. But the given one is compatible for C++ , so please kindly advise me the C# version of the method. (void)setsockopt(m_serverSocket, SOL_SOCKET, SO_RCVBUF,…
Raj
  • 151
  • 1
  • 14
0
votes
1 answer

setsockopt in kernel module

How can we set the ttl field using setsockopt in kernel hook module? We can put an entry in iptables mangle but is there an alternative better way? I am currently using ubuntu 14.04, kernel 3.13.2 CPU is 32 bit
Nofel Yaseen
  • 51
  • 2
  • 11
0
votes
0 answers

Modifying Options Field in IPv4 Header in Python

I am writing a somewhat atypical traceroute application in python. I am interested in counting the number of hops a packet takes before reaching its destination. The trick is I am interested in only probing with a single outgoing packet. I believe I…
Aroto
  • 311
  • 1
  • 12