Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
155 user(s) are online (108 user(s) are browsing Forums)

Members: 2
Guests: 153

orgin, TheMagicSN, more...

Headlines

 
  Register To Post  

A socket problem in Freeciv
Quite a regular
Quite a regular


See User information
I've gotten both Freeciv 2.1.9 and 2.2.1 sort of working. A notable problem that comes to mind is the very unreliable fetching of metaservers. It's not a server or DNS problem since my browsers have never failed it. The address is meta.freeciv.org/metaserver.phtml

I should also clarify that connecting to a local server works perfectly. While I haven't connected to very many other servers, I didn't see a problem with that, either.

Since elimination one issue at a time should work, I'm putting a somewhat likely snippet below. It is in utility/netintf.c , supposed to put the socket in non-blocking mode. So if you know this specific thing to already work in OS4, I can at least look at something else.

(config.h has #define HAVE_FCNTL 1 put there by freeciv 2.1.9 configure script, 2.2.1 configure script didn't work for me)

void fc_nonblock(int sockfd)
{
#ifdef NONBLOCKING_SOCKETS
#ifdef HAVE_WINSOCK
unsigned long b = 1;
ioctlsocket(sockfd, FIONBIO, &b);
#else
#ifdef HAVE_FCNTL
int f_set;

if ((f_set=fcntl(sockfd, F_GETFL)) == -1) {
freelog(LOG_ERROR, "fcntl F_GETFL failed: %s", fc_strerror(fc_get_errno()));
}

f_set |= O_NONBLOCK;

if (fcntl(sockfd, F_SETFL, f_set) == -1) {
freelog(LOG_ERROR, "fcntl F_SETFL failed: %s", fc_strerror(fc_get_errno()));
}


The function fc_nonblock is in client/servers.c

Thanks for listening.

Go to top
Re: A socket problem in Freeciv
Not too shy to talk
Not too shy to talk


See User information
@Thematic

It's great to hear your getting FreeCiv running! I look
forward to your results.

While I can't help you with the code, I did try to load
your URL in IBrowse:

meta.freeciv.org/metaserver.phtml

Unfortunately, IB just hung. After a while, IB complained
the page couldn't be loaded. But when I stripped off the
page name and just loaded the URL:

meta.freeciv.org

As such, IB loaded a page full of servers without delay.

Maybe this has something to do with your problem?

Good luck!

PJS

Go to top
Re: A socket problem in Freeciv
Quite a regular
Quite a regular


See User information
@pjs

Thank you for your input. I tried a relink with the shorter address since it was trivial to do, but it made no difference, so I undid that change.

Go to top
Re: A socket problem in Freeciv
Quite a regular
Quite a regular


See User information
This issue seems to have resolved itself somehow.

Go to top
Re: A socket problem in Freeciv
Amigans Defender
Amigans Defender


See User information
@Thematic

if a connection to a local server is working correctly the problem is not in the code but somewhere else.
IIRC you had this problem also in the past?

i'm really tired...
Go to top
Re: A socket problem in Freeciv
Quite a regular
Quite a regular


See User information
@afxgroup

When I tried the server browsers (spring/summer) with version 2.1.9 and 2.2.1, it didn't work at all. Now with 2.2.3 it's worked most of the time. *shrug* I haven't tried eg. 2.2.1 since September - but netintf.c is unchanged.


Edited by Thematic on 2010/11/17 16:12:21
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 1 ( 0 members and 1 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project