Back to index

courier  0.68.2
testprog.c
Go to the documentation of this file.
00001 /*
00002 ** Copyright 2000-2006 Double Precision, Inc.
00003 ** See COPYING for distribution information.
00004 */
00005 
00006 #include      "soxwrap.h"
00007 #include      <stdlib.h>
00008 #include      <stdio.h>
00009 
00010 
00011 int main(int argc, char **argv)
00012 {
00013 int    fd=sox_socket(PF_INET, SOCK_STREAM, 0);
00014 struct sockaddr addr;
00015 socklen_t     addr_len;
00016 
00017        if (fd < 0)
00018        {
00019               perror("socket");
00020               exit(1);
00021        }
00022 
00023        addr_len=sizeof(addr);
00024 
00025        if (sox_getsockname(fd, &addr, &addr_len))
00026        {
00027               perror("getsockname");
00028               exit(1);
00029        }
00030 
00031        sox_close(fd);
00032        exit(0);
00033        return (0);
00034 }