Questions tagged [winsock]

In computing, the Windows Sockets API (WSA), which was later shortened to Winsock, is a technical specification that defines how Windows network software should access network services, especially TCP/IP.

It defines a standard interface between a Windows TCP/IP client application (such as an FTP client or a web browser) and the underlying TCP/IP protocol stack. The nomenclature is based on the Berkeley sockets API model used in BSD for communications between programs. Initially, all the participating developers resisted the shortening of the name to Winsock for a long time, since there was much confusion among users between the API and the DLL library file (winsock.dll) which only exposed the common WSA interfaces to applications above it. Users would commonly believe that only making sure the DLL file was present on a system would provide full TCP/IP protocol support.

The Windows Sockets API specification defines two interfaces: the API used by application developers, and the SPI, which provides a means for network software developers to add new protocol modules to the system. Each interface represents a contract. The API guarantees that a conforming application will function correctly with a conformant protocol implementation from any network software vendor. The SPI contract guarantees that a conforming protocol module may be added to Windows and will thereby be usable by an API-conformant application. Although these contracts were important when Windows Sockets was first released, as network environments required multi-protocol support (see above) they are now of only academic interest. Included in the Windows Sockets API version 2.0 are functions to use IPX/SPX, but no commercial application is known to exist which utilises this transport, since the protocol was all but obsolete already at the time WSA 2.0 shipped. Microsoft has shipped the TCP/IP protocol stack with all recent versions of Windows, and there are no significant independent alternatives. Nor has there been significant interest in implementing protocols other than the TCP/IP family (includes UDP and RTSP), IrDA, and Bluetooth.

http://en.wikipedia.org/wiki/Winsock

2297 questions
0
votes
3 answers

Socket recv() function

In c++, in windows OS, on the recv() call for TCP socket , if the socket connection is closed somehow, the recv() will return immediately or will it hang? What would be result(immediately returns or hangs) in the blocking and non blocking…
user369287
  • 692
  • 8
  • 28
0
votes
2 answers

GetQueuedCompletionStatus returns ERROR_NETNAME_DELETED on remote socket closure

I am writing a small server-client-stuff using an I/O-Completion Port. I get the server and client connected successfully via AcceptEx over my completion port. After the client has connected the client socket is associated with the completion port…
Juarrow
  • 2,232
  • 5
  • 42
  • 61
0
votes
2 answers

Multiple Socket client connecting to a server

I am designing an simulator application where the application launches multiple socket connection(around 1000 connections) to a server. I don't want to launch as many as threads to handle those connections, since the system cant handle that much…
Jeeva
  • 4,585
  • 2
  • 32
  • 56
0
votes
0 answers

Making looping winsock server

This example simply accepts one request then dies. I want it to keep receiving new requests. How should I change it to looping one just like http server which keeps on receiving…
user5858
  • 1,082
  • 4
  • 39
  • 79
0
votes
1 answer

Missed connections using select() on many non-blocking connecting TCP sockets on windows XP

I have a small portable tool which connects to around 150 servers at diverse locations to get a quick status check from them. It is important to get the status for all servers back to the user relatively quickly so the tool connects to the servers…
Al Riddoch
  • 583
  • 2
  • 9
0
votes
0 answers

Unable to connect to my winsock server using external IP

When I try to connect to my server using localhost IP or my LAN IP, everything works fine and the client successfully connects. Problems begin once I attempt to connect to the server using my external IP - I get just WSAETIMEDOUT error then and the…
Jason
  • 33
  • 1
  • 6
0
votes
1 answer

Winsock's send() works oddly

I'm trying to write an experimental server program that accepts a connection and sends a message to the client. I got the client to connect, but I can't seem to send the message without doing really odd things. For example, in this snip, conn is a…
user400935
0
votes
1 answer

Stop EIdWinsockStubError, WSACancelBlockingCall error appearing when closing Internet Explorer

I have an ASP.NET application where one of the pages hosts a 3rd party ActiveX control. A condition can sometimes occur with the ActiveX control that causes the following error message to be displayed in a Windows dialog box when Internet Explorer…
Gary Joynes
  • 656
  • 7
  • 23
0
votes
1 answer

accept() returns SOCKET_ERROR without connection request

I'm making an application to test TCP connections and study network protocols. The same application is Client or Server depending the user parameters. I'm developing it on Windows 10 using Dev-Cpp 5.11. But, when I try to run it like a server I get…
0
votes
1 answer

400 bad request error when send a GET http request by using winsock library

I'm trying to send a GET request to a webserver(example: www.coursera.org,...). But sServer returns a response header: HTTP/1.1 400 bad request I used Winsock in C++ and establish a socket connect to server. Then, send a GET request to…
hugtech
  • 877
  • 3
  • 11
  • 16
0
votes
2 answers

Winsock recv() function blocking other threads

I’m writing a simple Windows TCP/IP server application, which only needs to communicate with one client at a time. My application has four threads: Main program which also handles transmission of data as needed. Receive incoming data thread. Listen…
0
votes
0 answers

Handle logout and sorting in an array of socket threads

Ii have a server in c (winsock) for multiple connections using ThreadCreate() and i store all the new client sockets in an array. Handle peers[10]. By now when i receive data from 1 peer i only loop throug the array and send the data on every…
DoJo
  • 45
  • 9
0
votes
0 answers

Winsock Bluetooth get socket handle of active connection

So I am trying to monitor the traffic of an active Bluetooth connection on my PC. I am able to get get several information about the active connection to the remote device, e.g. SOCKADDR_BTH. I thought I could use the port information of the remote…
Nawin
  • 63
  • 1
  • 7
0
votes
1 answer

Strange IOCP behaviour when communicating with browsers

I'm writing IOCP server for video streaming from desktop client to browser. Both sides uses WebSocket protocol to unify server's achitecture (and because there is no other way for browsers to perform a full-duplex exchange). The working thread…
Iceman
  • 365
  • 1
  • 3
  • 17
0
votes
1 answer

Windows winsock networking code: What am I missing?

I saw something that was a red flag for me when I ran this: nc -l -u -p 1500 This netcat command makes it listen for packets from UDP port 1500. Once i ran this on the windows command line, I immediately got a Windows Firewall has disabled…
Steven Lu
  • 41,389
  • 58
  • 210
  • 364
1 2 3
99
100