Re: Problem with bsd sockets
Re: Problem with bsd sockets
- Subject: Re: Problem with bsd sockets
- From: Robert Tillyard <email@hidden>
- Date: Fri, 3 Jan 2003 19:44:27 +0000
Not sure if it's the cause of your problem but I think you need an
extra set of brackets around the first line, i.e.
if ((sockfd = socket (AF_INET, SOCK_STREAM, 0)) < 0) {
Regards, Rob.
On Friday, January 3, 2003, at 07:22 pm, Quentin Mathi wrote:
When I run the code below in Cocoa application with Project Builder, I
get an error : socket already connected everytime, even when my
internet connection is turned off. I have found no explanation about
this problem in the book Unix network programming I hope someone can
help me
int sockfd; // socket file descriptor
struct sockaddr_in serverAddress;
char buffer[201];
int n;
if (sockfd = socket(AF_INET, SOCK_STREAM, 0) < 0) {
perror("socket");
exit(1);
}
...
--
Quentin Mathi
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.