winsock

Winsock - 10038 Error - Win2K3 Server - baffling behaviour

Attempt to send a message through a socket failed with WinSock error 10038. After around 40 seconds, messages are received successfully from the same socket and subsequently the send() is also succeeding in the same socket. This behaviour has been witnessed in Windows Server 2003. Is this any known behaviour with WinSock and Windows Serv...

What is a good tutorial/howto on .net / c# socket programming.

I'm porting old VB6 code that uses the Winsock control to C#. I haven't done any socket programming and I wonder if anyone has a good reference/tutorial/howto that I can use to start getting up to speed. I'm appealing to the hive mind while I proceed with my generally unproductive googling. I'm using UDP, not TCP at this time. ...

MSWinsock.Winsock event handling in VisualBasic

I'm trying to handle Winsock_Connect event (Actually I need it in Excel macro) using the following code: Dim Winsock1 As Winsock 'Object type definition Sub Init() Set Winsock1 = CreateObject("MSWinsock.Winsock") 'Object initialization Winsock1.RemoteHost = "MyHost" Winsock1.RemotePort = "22" Winsock1.Connect Do Wh...

Socket Exception: "There are no more endpoints available from the endpoint mapper"

I am using winsock and C++ to set up a server application. The problem I'm having is that the call to listen results in a first chance exception. I guess normally these can be ignored (?) but I've found others having the same issue I am where it causes the application to hang every once in a while. Any help would be greatly appreciate...

undeclared identifier SO_EXCLUSIVEADDRUSE when building Apache Axis2/C

I'm attempting to build Apache Axis2/C (actually I'm building the WSO2 WSF/C++ wrapper for it) and it keeps giving me an error when it comes across the symbol SO_EXCLUSIVEADDRUSE. It's a socket option, and MSDN says it should be available. I'm using MSVC++ 6.0 on Win Server 2k3. I don't have a choice about the compiler or the OS... if...

Is there any benefit to using windows winsock API functions compared to BSD-style socket functions?

Is there any benefit on Windows to use the WSA winsock functions compared to the BSD-style ones? ...

Best resource for learning more about using winsock

I am a Software engineering student, well-versed in C++, but I am interested in programming using I/O from more varied sources than just file I/O with .txt files. For example, I have heard a bit about using winsock and win32 to get input and output over networks. Does anyone know of a good resource for this? ...

Difference between winsock and linux sockets

I'm developing an FTP-like program to download a large number of small files onto an Xbox 360 devkit (which uses Winsock), and porting it to Playstation3 (also a devkit, and uses linux AFAIK). The program uses BSD-style sockets (TCP). Both of the programs communicate with the same server, downloading the same data. The program iterate...

How do I get the source IP address from a datagram's IP header with Winsock?

I have a port that is bind()'d to INADDR_ANY. I am receiving datagrams successfully. After receipt, I need to read the IP header to get the source IP address. ...

send bitmap with winsock

How could you send a bitmap over winsock without saving it to a file then sending that? It would also be helpful if you knew how to convert the data after being recieved back into a bitmap. ...

Microsoft Patch 958369 MS08-070 broke my VB6 App (Type Mismatch - dynamically created control)

We upgraded our machines with a microsoft patch listed above and are now having issues with some winsock controls. While moving on to the new component library there were two issues that we faced: We are creating a Winsock control dynamically using Form.Controls.Add(...). With the new dlls it gave us a run time error 731 stating that...

Custom app using Winsock vs IIS Server design

I have a server application developed using C++ running on Windows platform. This server uses Windows sockets to communicate with clients using TCP. The socket server architecture inside the application is quite simple. The application pools 'x' number of threads during startup. Whenever a new client connects to the server, one of the th...

winsock missing data c++ win32

Hello, I am writing an application that needs to send data over a network. I have the application completed but there is a problem with sending the data. Every time I send a piece of data, it is cut off after 4 characters and the rest is garbage. The application is a remote keylogger I am writing for a school project, which requires you...

Mixing File Handles and Sockets in Winsock

I'm porting some code from BSD sockets to Winsock, and I'm not sure how to handle the case below. My original application runs a select on both stdin and the network socket: FD_SET(sock, &fd); FD_SET(0, &fd); ... if (select(..., &fd, ... )...) Trying to run this in Winsock gives an error 10038 (WSAENOTSOCK), which makes sense, since ...

alternatives to winsock2 with example server source in c++

Hi, i'm using this example implementation found at http://tangentsoft.net/wskfaq/examples/basics/select-server.html This is doing most of what I need, handles connections without blocking and does all work in its thread (not creating a new thread for each connection as some examples do), but i'm worried since i've been told winsock wil...

Implementing Java's getResponseCode() in C?

If it's any help, there is also a similar class in C#'s WebRequest. Although I do not want it in java or .NET, i am wondering how to implement this in native C/C++ code (for windows). for reference: try { URL url=new URL("http://google.ca"); HttpURLConnection con=(HttpURLConnection)url.openConnection(); con.connect(); int code = con.g...

Why would recv fail when the requested buffer size is greater than the amount of data available?

Underlying the TCP transport stack are a number of buffer limits sometimes documented by their authors. On WinXP SP3 I've run into one of these, I think, and can't figure out why. I have implemented a simple client to get data from a server (written by a colleague in Java). The protocol is to write the length of the data (in network o...

Does unblocking connect to socket cause a context switch?

I'm using winsock and calling connect on a non-blocking socket. I occasionally see some delay (up to 200ms) before the function returns when the CPU is hogged by other processes. From what I know, a connect on a non-blocking socket should return immediately, but perhaps connect causes a context switch and since the CPU is working hard it...

Error 10048 when trying to open TcpChannel

Hello! I'm pretty inexperienced in Remoting. I'm trying to use it and keep receiving WinSock error 10048 when opening TcpChannel. I use the simplest code from MSDN: TcpChannel serverChannel = new TcpChannel(9090); ChannelServices.RegisterChannel(serverChannel); RemotingConfiguration.RegisterWellKnownServiceType( ty...

why bind() returns SOCKET_ERROR

Without: MFC ATL Using pure C++, WSAGetLastError() returns 10014 - Bad address What I'm I missing/doing wrong? Code illustration: sockaddr_in sin; SOCKET server; if ((server = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == SOCKET_ERROR) { cerr << "Error: socket() return value == SOCKET_ERROR" << endl; WSACleanup(); exit (EXI...