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

How can BLE devices be connected using the socket API of Windows7? It basically works but I'm having issues

I'm working on a C++ application that communicates with my custom (nRF52840-based) hardware through BLE. The application should work on Windows, and it would be good to support Windows 7 too. Despite the fact that there is no official BLE support…
vjalle
  • 549
  • 4
  • 13
0
votes
1 answer

recv(): Constant object cannot be passed as var parameter (on second arg of this function)

I need make a Delphi version of following C code and now i got the error saying that "not is allowed": a value of PByte + a Integer value, passed on second arg of recv() function. Have you some idea about a possible solution? This is C…
FLASHCODER
  • 1
  • 7
  • 24
0
votes
1 answer

Windows API for Socket SSL

I am working on a C client/server program. Right now my code is just using normal winsock sockets to open a connection and send and receive. My next step is to add SSL/TLS to it. I have played around with OpenSSL and embedTLS. Both worked, but…
Halloween
  • 388
  • 3
  • 15
0
votes
0 answers

recv() returning SOCKET_ERROR

Right now I am currently trying to learn winsock, and to do so I'm trying to just send a file over a socket. I have written all of the code, and I got it to partially work, sending only the top part of an image, but now it has just completely…
0
votes
0 answers

Weird connection message from websocket to WinSock

Edit: I am now getting the messages as I wanted when I set CONNMSG size to [0]. This way, I don't see http header anymore. Image with Correct messages I have a c++ desktop software which I will consider as a server because my browser side software…
no more sigsegv
  • 468
  • 5
  • 17
0
votes
0 answers

WinSock: How send() a PByte type?

Firstly, i want know if the PByte type is equivalent to a BYTE*(byte pointer) in C++. In negative case, what's could be on Delphi that more near to BYTE* of C++? Well, suppose that i'm right about that PByte is BYTE* (C++), then based on following…
FLASHCODER
  • 1
  • 7
  • 24
0
votes
2 answers

Connect Keeps Failing With Error 10049 in C

I'm new to socket programming and this is my first server-client program. The program was working perfectly fine at first, but when I copied my code from Server.c and Client.c to a new project in Visual Studio, my client is now refusing to connect…
NoobxCamper
  • 33
  • 1
  • 2
  • 14
0
votes
0 answers

Winsock UDP IO Completion Port: Unable to use WSASendTo

I am trying to write a UDP server with a worker thread that keeps calling GetQueuedCompletionStatus. I can already receive data successfully with WSARecvFrom but sending data with WSASendTo causes the following error: 10045: The attempted operation…
user3670011
  • 194
  • 11
0
votes
1 answer

Why when I add POLLHUP as event, WSAPoll returns error (invalid arguments)?

I'm using WSAPoll for my project. I used tracking POLLIN and POLLOUT events. Everything worked nice. When I add POLLHUP as event, WSAPoll returns error 10022 (Invalid argument). I've no idea what's wrong, please guide me how to fix it:( cc_qnt -…
Roma
  • 55
  • 8
0
votes
0 answers

Winsock Kernel - Reusing socket return error 0xc0000184

I am developing WDF driver that uses Winsock Kernel module connecting network. I have encounter problem when I try to reuse socket. I am successfully creating, binding and connecting socket. After that I am disconnecting socket with WskDisconnect…
0
votes
1 answer

How to fetch an IP address of a socket inside a fd_set?

Hey Im storing all connected sockets in a fd_set. I want to iterate through the sockets and display the IP address. ZeroMemory(host, NI_MAXHOST); ZeroMemory(service, NI_MAXSERV); inet_ntop(AF_INET,…
D.H.
  • 186
  • 14
0
votes
0 answers

Winsock2 can't connect to ip

First of all i already disabled my firewall, added rules for the port (TCP&UDP), port forwarded on my router. I'm trying to do a login system with winsock but client wont connect to the server whenever I'm inputting a ipv4. But if i use 127.0.0.1 it…
0
votes
1 answer

C# Client halted while connecting with C++ Server, but works fine when connecting with C# Server

I have C# Client and C# Server Programs that connected with each other successfully and works fine. But when i want to connect C# Client with C++ server then C# client gets halted while C++ Server produces success messages of "winsock initialization…
shakeel
  • 75
  • 8
0
votes
0 answers

Winsock working on local IP but not online

Hello sorry for asking but I've tried looking everywhere and I can't get this working. I can send packets to my local IP address just fine but not to my online IP address. I've tried microsofts winsock example code and even that is not working. My…
andrew
  • 1
0
votes
1 answer

Why does a packet sent using PCap.NET not fill out the TCP options?

I am trying to use PCap.NET to send a SYN packet to a destination. When using the WinSock API I can see the TCP Options in Wireshark.... But when I use PCap.NET to build and send the packet, the options are not included. Here is the TCP layer I use…
kdun0508
  • 75
  • 10