Which socket, the clientSocket = accept() or the listen(socket), do you setsockopt SO_KEEPALIVE on?
Which socket, the clientSocket = accept() or the listen(socket), do you setsockopt SO_KEEPALIVE on to get the connection to clients not to drop? ...
Which socket, the clientSocket = accept() or the listen(socket), do you setsockopt SO_KEEPALIVE on to get the connection to clients not to drop? ...
int Socket::Connect(const std::string& host, int port) { if(this->_connected) throw "Socket is already connected"; // Get the IP from the string hostent* ip = gethostbyname(host.c_str()); /*if(server == NULL) throw strerror(WSAGetLastError());*/ // Information for WinSock. sockaddr_in addr; ...
In order not to flood the remote endpoint my server app will have to implement a "to-send" queue of packets I wish to send. I use Windows Winsock, I/O Completion Ports. So, I know that when my code calls "socket->send(.....)" my custom "send()" function will check to see if a data is already "on the wire" (towards that socket). If a da...
Hello , i have a simple server that accepts clients. The client connect to the server. The first thing the server will do the following: grab the client socket create a thread for client call ::recv(); the problem here is that recv returnes -1 WSAGetLastError returnes WSAENOTSOCK: (Socket operation on nonsocket.) Microsoft: "An oper...
I'm using the MS Winsock control in VB6 and I want to understand things like "when does the Server Close the connection (triggering the Winsock_Close() event), and a related question: How do you know when all the data from a a Post has been returned? More info: I should have mentioned: I've already read the MSDN description, etc....
I'm using the VB6 Winsock control. When I do a POST to a server I get back the response as multiple Data arrival events. How do you know when all the data has arrived? (I'm guessing it's when the Winsock_Close event fires) ...
Hello there guys It is pure winsock server question. Just to clear that I already know how threads work. I have global sockets called Global and Main_Socket. long __stdcall newthreadfunction(); //prototype of new thread function SOCKET Global; // To be shared and copied by thread SOCKET Main_Socket; //main listening socket WSADATA w...
In C++ using Windows32 using windows socket library using UDP is there a way to give a client routing information to another client to establish a connection between clients without having to route through the server Clarification: server - waits for computers and gives routing info - a detached server client - sends a ack request and ...
I've made a simple dummy server/dummy client program using IOCP for some testing/profiling purpose. (And I also wanted to note that I'm new to asynchronous network programming) It looks like the server works well with original client, but when the dummy client tries to connect to the server with ConnectEx function, IOCP Worker thread st...
Hi, I'm wondering if anyone knows how to calculate the upload speed of a Berkeley socket in C++. My send call isn't blocking and takes 0.001 seconds to send 5 megabytes of data, but takes a while to recv the response (so I know it's uploading). This is a TCP socket to a HTTP server and I need to asynchronously check how many bytes of ...
I have the source for a cross-platform library. It compiles fine under MSVC but I'd like to compile it under MinGW. The MinGW winsock2.h does not contain a definition for the defintion for struct ip_mreq, which is found in Windows' SDK WinSock.h file. What is an elegant way to go about fixing this (among other discrepancies yet to be d...
Hi, how can i access to the socket, that is used by web browser. Or how can i get data transfered between web browser and web server. I need to connect to that socket and modify the data, the web browser sends and recieves. What concrete functions should i use? I studiend the msdn documentation about this, but didnt noticed how do i get...
The winsock function socket expects as third parameter the protocol what usually is IPROTO_TCP for socket type SOCK_STREAM and IPROTO_UDP for socket type SOCK_DGRAM. When I pass a 0 value as the protocol parameter, TCP and UDP work as expected. SOCKET s = socket(AF_INET, SOCK_DGRAM, 0) // s is a valid socket What is the IPROT...
Background: We have a client/server application that uses a persistent connection to the server. Benchmarks show that it is many times faster to use an already open connection rather than spend significant time (2.5 seconds) setting up a new connection (crypto). Unfortunately, the old connection may be stale. Is there a way to wait f...
Hi, on windows, is there any other option when programming network communication then using Winsock? There are many socket libraries for c++, are they all just winsock based? ...
Hi. For example i create socket using winsock under account named Admin. Is there any possibility to detect which user created that socket? I would like to write in my program: This socket was created by "Admin". i am using c++ ...
Hello, I have win32 application in which winsock is used for TCP/IP communication. I am setting keepalive value with WSAIoctl function and it is working normally with windows XP. But on Win. Server 2008 WSAIoctl fails, and WSAGetLastError returns 10022(invalid arguments) which does not make any sense. My code which sets keepalive is fo...
When a server receives a WSAECONNABORTED from a device (coming in from a send()), should a connection be re-established and data re-sent or should the server bail out and drop the connection? Thanks. ...
Hello. I need to pass a native winsock socket created by C++ application to a library in my application that uses java.net.Socket to connect to a server. This winsock appication already take care of connecting the socket. how can I explicitly set the socket descriptor of java.net.Socket? ...
I am developing a program on top of a basecode taking care of low level socket programming. The problem seems to be that the only way it knows (apparently) when to stop close the connection is when the amount of bytes received exceed that given in the "Content-length" field. But since that field is not set for many sites I don't know how...