Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 30 Apr 1999 12:12:14 -0700 (PDT)
From:      Doug White <dwhite@resnet.uoregon.edu>
To:        Greg Campbell <greg.campbell@matrikon.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: socket communication
Message-ID:  <Pine.BSF.4.03.9904301210310.16807-100000@resnet.uoregon.edu>
In-Reply-To: <000f01be9323$ce6e5bf0$9308a8c0@matrikon.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 30 Apr 1999, Greg Campbell wrote:

> I would appreciate some words of wisdom from anyone
> who has done some socket programming on FreeBSD.
> 
> The question is this:
> Is there anything special about connecting to a
> socket from FreeBSD? I am getting an error from
> the "connect" function call (nothing more than
> -1 is returned which doesn't seem to map to any
> error messages codes. 
> 

Read your man pages; the error is returned in the global variable errno.
Use 

perror("connect");

to have the system error printed automatically instead of your custom
oops() function.

Doug White                               
Internet:  dwhite@resnet.uoregon.edu    | FreeBSD: The Power to Serve
http://gladstone.uoregon.edu/~dwhite    | www.freebsd.org



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.03.9904301210310.16807-100000>