Well, my project is dead in the water until I can find another way to convert an int into a socket. Does anyone know of a third party lib I can use in visual c that handles converting ints to sockets?
Are you calling WSAStartup()?
Did you check the return value of send()?
Have you looked at any working example code (e.g. sbbs/xtrn/sdk)?
Re: Winsock2 woes
By: Xucaen to Digital Man on Thu Nov 26 2015 10:01 am
#pragma comment(lib, "Ws2_32.lib")
#include <WinSock2.h>
Then I have a function that writes data to the socket
void IOHandler::writeBytes(string line) const
{
if (dropfile->commType == 0)
{
cout << line;
}
else if (dropfile->commType == 2)
{
int bytes = ::send((SOCKET)dropfile->handle, line.c_str(), strlen(line.c_str()), 0);
}
}
Are you calling WSAStartup()?
Sysop: | Tandy |
---|---|
Location: | New York, USA |
Users: | 15 |
Nodes: | 13 (0 / 13) |
Uptime: | 15:37:31 |
Calls: | 335 |
Messages: | 112,962 |