[gnet] RE: gnet 2.0.5 on windows with mingw/msys



Brian,

I did get it to compile (and run) on MinGW/MSYS, but I had to make a few
changes to one of the files.  I was only trying to get Pan working, which I
did, and afterwards simply left the matter as-is.  What I did may be a
gigantic hack though.

I don't have access to the source I modified right now (forgot to open up
SSH on the home computer after installing SP2 ... Sigh), but if you're
interested I can have a look later tonight. 

Regards,

Stephane

> ------------------------------
> 
> Message: 2
> Date: Thu, 19 Aug 2004 13:09:39 -0400
> From: Brian Hrolenok <hroly kfb gmail com>
> Subject: [gnet] gnet 2.0.5 on windows with mingw/msys
> To: gnet lists gnetlibrary org
> Message-ID: <c23d6f9c0408191009773ed328 mail gmail com>
> Content-Type: text/plain; charset=US-ASCII
> 
> Hi there folks!
> I'm trying to use gnet as part of a cross platform networking 
> project, and every thing seems to work fine on my alternative 
> OS's (linux, os x, etc.), but I seem to be running into a 
> problem related to Stephane Rouleau's who posted earlier (In 
> the Feb. Archive for '04.
> I couldn't find a reply, and his post was more of a statement 
> than a question, but anyway).
> 
> I've gotten both glib and gnet compiled from scratch and 
> installed using Mingw/MSYS, however the example programs do 
> not run.  In particular, I've traced echoserver's failure to 
> the error code (from WSAGetLastError()) 10093.  Now, the msdn 
> site says:
> 
> "Either the application has not called  WSAStartup or  
> WSAStartup failed. The application may be accessing a socket 
> that the current active task does not own (that is, trying to 
> share a socket between tasks), or  WSACleanup has been called 
> too many times."
> 
> and after a quick perusal of recent gnet mailing list 
> activity, I found Stephane's post.  I figured that for some 
> reason WSAStartup just wasn't being called, and dropped in a 
> snippet of code from gnet-private.c to the top of 
> echoserver.c, which promptly broke the example and led me to 
> believe that WSAStartup *was* being called, and one of the 
> other conditions was causing the failure.
> 
> To begin with, I had thought that either the windows TCP/IP 
> stack was messed up, or there was a hardware problem, and 
> thats why I tried getting the error codes from 
> WSAGetLastError.  Then, I began to suspect that it was a 
> networking misconfiguration (the subnet that the machine I'm 
> testing this on is cut off from everything else on our larger 
> network by a firewall that only lets ssh out, and dns both 
> ways (requests out, replies back in)), but our Sysadmin came 
> by and double checked everything, and we ran a few other 
> networking apps that had no problems running (all windows 
> native though).
> After looking into this, and trying alternatives to gnet (Qt, 
> with QSocket and QSocketDevice) I'm pretty sure this is an 
> issue specific to gnet under MinGW/MSYS.  (The Qt examples 
> compiled and ran sucsessfully.) If anybody could point out if 
> I'm doing something obviously wrong, or if they've had 
> similar problems, I would greatly appreciate it.
> Thanks!
> -Brian Hrolenok
> 
> Output BEFORE I changed anything:
> 
> $./echoserver 1234
> (process 2856): GNet-WARNING **:can't set reuse on tcp socket 
> Could not create server on port 1234
> 
> end output.
> 
> Output AFTER I added printf("%d \n",WSAGetLastError()) after 
> gnet_tcp_socket_server_new_with_port returned null:
> 
> $./echoserver 1234
> (process 3152):GNet-WARNING **:can't set reuse on tcp socket
> 10093
> Could not create server on port 1234
> 
> end output.
> 
> Code listing which broke echoserver.c when I dropped it in follows:
> 
> /* My changes.  Before anything else in main(). */
> /* <Windows.h> gets included up at the top.*/ WORD foo; 
> WSAData bar; int baz; foo = MAKEWORD(2,0); baz = WSAStartup(foo,&bar);
> printf("Version: %d.%d \n Error(baz): %d \n 
> Error(WSAGetLastError): %d 
> \n",LOBYTE(bar.wVersion),HIBYTE(bar.wVersion),baz,WSAGetLastError());
> /* End of my changes.  Rest of main() follows */
> 
> End code listing.
> 
> Output:
> 
> $./echoserver.exe 1234
> (process 4044): Gnet-WARNING **:  can't set reuse on tcp 
> socket Version 2.0
> Error(baz): 0
> Error(WSAGetLastError): 10038
> Could not create server on port 1234
> 
> End output.
> 
> 10038 is WSAENOTSOCK, which says something about performing 
> socket operations on something that's not a socket.  I 
> figured that since the WSAStartup was returning stuff that 
> shouldn't make the gnet-private.c function fail, that the 
> 10038 error was happening because WSAStartup was being called 
> twice, or because I had put it in a funky place or something 
> like that.  Let me know if you want any other output!
> 
> 
> ------------------------------
> 
> _______________________________________________
> gnet mailing list
> gnet lists gnetlibrary org
> http://lists.gnetlibrary.org/mailman/listinfo/gnet
> 
> 
> End of gnet Digest, Vol 12, Issue 7
> ***********************************




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]