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
0 answers

C++ Server Response Is displaying Header Information On Client Page WebSocket Winsock Windows VS

I am attempting to send an HTML page over a WebSocket using C++ EDIT: I've updated the response header to **not** specify how many characters are being sent via char response[] = "..."; I've added to the header the Content-Type and Content-Length…
Allie Marie
  • 27
  • 1
  • 8
0
votes
0 answers

Winsock server how to re-listen on the same port

Hello I have an application which has a role of server in TCP connection. I use async sockets and I listen by listen() method. My question is how to listen again on the same port when client will disconnect. Now I have to quit application manually…
Kutti
  • 486
  • 1
  • 6
  • 17
0
votes
1 answer

UDP Server with 2 clients, how to assign a specific port to them

I have a small problem , I have a Server and Client applications. And here what is I want, when I run Server + Client the messages are received from Port 15011 because I've bind it inside the Client file, but I want to run, 2 clients at once, then…
Stefan
  • 375
  • 1
  • 9
  • 24
0
votes
0 answers

recvfrom() doesn't get any UDP messages

I'm trying to get UDP messages that are being sent from different applications on my machine. I created a socket and bind it to an address. When I send UDP messages using Packet Sender, nothing arrives. I tried disabling the firewall just to be…
Alophind
  • 842
  • 2
  • 12
  • 27
0
votes
0 answers

changing the order of the data inside of a file using seekg, tellg function

I'm new to c++ programming. I have a small excercise which enables the use of the following: using of windows socket programming, using of window api functions (CreateFile, ReadFile, and WriteFile), and using of seekg, seekp, tellg, and tellp…
frrelmj
  • 9
  • 4
0
votes
1 answer

allocate the memory of the http request data

I'm currently doing a program in c++ related to windows socket. On the part where I'm going to receive the answer from an http request and put the data inside of a buffer, I declared the size of the buffer which is 10000, my question is how can I…
frrelmj
  • 9
  • 4
0
votes
1 answer

How to resolve IP Addresses into Hostnames in Windows Kernel Driver

I am writing a Windows Kernel Driver, in which I need to resolve IP addresses into corresponding hostnames. There is very little documentation available for this on Microsoft pages: Resolving Host Names and IP Addresses How can this be done? What…
Ramchandra
  • 1
  • 1
  • 1
0
votes
1 answer

Winsock getaddrinfo unhandled exception/crash in ntdll.dll

I'm trying to resolve a hostname in C with GetAddrInfoExW() struct addrinfoexW hints, *res; int errcode; void *ptr = 0; ZeroMemory(&hints, sizeof(struct addrinfoexW)); hints.ai_family = PF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags |=…
manner
  • 33
  • 3
0
votes
1 answer

Convert TCP server to UDP server

So I'm trying to create a Winsock UDP server out of a TCP server, but I just can't seem to get it to work. The official winsock documentation doesn't seem to cover UDP servers (atleast as far as I could find). The working TCP server is…
Rokas Višinskas
  • 533
  • 4
  • 12
0
votes
2 answers

Winsock accept() returning WSAENOTSOCK (code 10038)

hope you're having a good day. Another socket issue, another day :) I finally got MicroSoft Visual C++ (MSVC++) IDE installed, plus the Platform SDK, so I can compile winsock applications. Missed a chunk of stuff here. In the ServerSocket::accept()…
FurryHead
  • 1,479
  • 3
  • 16
  • 19
0
votes
2 answers

How to determine the site protocol using url

How do I determine (using c++ and winsock) the site protocol based on the URL, for example (www.google.com) if the protocol is not known in advance? Or how do I determine web server TCP port? I want do an HTTP get request using the link which…
0
votes
2 answers

winsock "invalid argument" error on listen

I was trying to make a simple client - server communication application, but I've come across a problem - I get error 10022 ( invalid argument ) on listen. WSADATA wsaData; int iResult; sockaddr_in addr; SOCKET sock, client; addr.sin_family =…
0
votes
0 answers

Winsock IOCP Weird Behaviour On Disconnect Flood

I'm programming a Socket/Client/Server library for C#, since I do a lot of cross-platform programming, and I didn't find mono/dotnet/dotnet core enough efficient in high-performance socket handling. Sice linux epoll unarguably won the performance…
beatcoder
  • 683
  • 1
  • 5
  • 19
0
votes
1 answer

Multicasting with Windows

I need to write an application that runs on Windows and receives Multicast messages. I have some specific questions. I normally use Winsock control but out the box it does not support multicast operations. Can anyone help with API to get round this…
Russell M
  • 1
  • 2
0
votes
1 answer

Name for new socket

I am learning socket programming, i had a problem. I want when people connecting to my server, i see his name(For example "on server connected Richard" ). How assign name to socket. P.S. Sorry for my English.
1 2 3
99
100