/[gcl]/gcl/o/sockets.c
ViewVC logotype

Diff of /gcl/o/sockets.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by camm, Sat Mar 1 22:37:37 2003 UTC revision 1.8.4.1 by camm, Wed Jul 16 02:02:51 2003 UTC
# Line 105  DEFUN_NEW("OPEN-NAMED-SOCKET",object,fSo Line 105  DEFUN_NEW("OPEN-NAMED-SOCKET",object,fSo
105  "Open a socket on PORT and return (cons fd portname) where file \  "Open a socket on PORT and return (cons fd portname) where file \
106  descriptor is a small fixnum which is the write file descriptor for \  descriptor is a small fixnum which is the write file descriptor for \
107  the socket.  If PORT is zero do automatic allocation of port")  the socket.  If PORT is zero do automatic allocation of port")
108  { int s, n, rc; struct  {
109  sockaddr_in addr;  #ifdef __MINGW32__
110        SOCKET s;
111    #else    
112        int s;
113    #endif    
114      int n, rc;
115      struct sockaddr_in addr;
116    
117  #ifdef __MINGW32__    #ifdef __MINGW32__  
118    if ( w32_socket_init() < 0 ) {    if ( w32_socket_init() < 0 ) {
# Line 117  sockaddr_in addr; Line 123  sockaddr_in addr;
123        
124    /* Using TCP layer */    /* Using TCP layer */
125    s = socket(PF_INET, SOCK_STREAM, 0);    s = socket(PF_INET, SOCK_STREAM, 0);
126    #ifdef __MINGW32__
127        if ( s == INVALID_SOCKET )  
128    #else    
129    if (s < 0)    if (s < 0)
130    #endif      
131      {      {
132        perror("ERROR !!! socket creation failed in sock_connect_to_name\n");        perror("ERROR !!! socket creation failed in sock_connect_to_name\n");
133        return Cnil;        return Cnil;
# Line 175  sockaddr_in addr; Line 185  sockaddr_in addr;
185        return Cnil;        return Cnil;
186      }      }
187    
188    return make_cons(make_fixnum(s), small_fixnum(ntohs(addr.sin_port)));    return make_cons(make_fixnum(s), make_fixnum(ntohs(addr.sin_port)));
189  }  }
190    
191  DEFUN_NEW("CLOSE-FD",object,fSclose_fd,SI,1,1,NONE,OI,OO,OO,OO,(fixnum fd),  DEFUN_NEW("CLOSE-FD",object,fSclose_fd,SI,1,1,NONE,OI,OO,OO,OO,(fixnum fd),

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.8.4.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26