This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

socket programming -- operation now in progress


I am testing a very simple socket program. It functions, but there's
still a nagging problem.
On connect(), I get an error "Operation now in progress."

The code:

#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>

int main()
{
	int sock = socket(PF_INET, SOCK_STREAM, 0);
	struct sockaddr_in time_serv;

	time_serv.sin_family = AF_INET;
	time_serv.sin_port = htons(37);
	inet_aton("129.6.15.28", &time_serv.sin_addr);
	connect(sock, (struct sockaddr*)&time_serv, sizeof(struct sockaddr));
	perror("connect");
	
	int num;
	
	read(sock, &num, 4);
	printf("%x\n", num);
}

Why am I getting this error? It seems especially odd, since the
program actually works. I'm running cygwin on win98se. I tried this
code on a Linux box, and did not receive the error message.

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]