Mail Archives: cygwin/1996/11/25/12:01:06
Hi! I fixed my source to make it work using socket and
gnuwin32_socket... I don't know if this is a hack or just an ingenious
(IMHO) use of the C++ language ;)
class wormHole {
int sock;
struct hostent *targetAddr;
struct sockaddr_in target;
public:
wormHole (int kind = streamSocket);
callTarget (char *target_name, int port);
socket (void) { return sock; }
};
wormHole::wormHole (int kind = streamSocket) {
printf("[%s socket]\n", kind == SOCK_STREAM ? "stream" : "datagram");
// old: sock = socket (AF_INET, kind, 0); assert (sock != -1);
sock = ::socket (AF_INET, kind, 0); assert (sock != -1);
}
See? Now I call the global socket... if I didn't put the :: operator
the compiler would think that I was using wormHole::socket().
[]s fabricio
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".
- Raw text -