Lines Matching refs:sd

44 # define sock_write(sd, buf, len) send((SOCKET)sd, buf, len, 0)  argument
45 # define sock_read(sd, buf, len) recv((SOCKET)sd, buf, len, 0) argument
46 # define sock_close(sd) closesocket((SOCKET)sd) argument
56 # define sock_write(sd, buf, len) write(sd, buf, len) argument
57 # define sock_read(sd, buf, len) read(sd, buf, len) argument
58 # define sock_close(sd) close(sd) argument
60 # define fd_write(sd, buf, len) write(sd, buf, len) argument
61 # define fd_close(sd) close(sd) argument
723 int sd = -1; in channel_connect() local
734 if (sd >= 0) in channel_connect()
735 sock_close(sd); in channel_connect()
736 sd = socket(server_addr->sa_family, SOCK_STREAM, 0); in channel_connect()
737 if (sd == -1) in channel_connect()
749 ioctlsocket(sd, FIONBIO, &val) < 0 in channel_connect()
751 fcntl(sd, F_SETFL, O_NONBLOCK) < 0 in channel_connect()
758 sock_close(sd); in channel_connect()
766 ret = connect(sd, server_addr, server_addrlen); in channel_connect()
782 sock_close(sd); in channel_connect()
788 sock_close(sd); in channel_connect()
809 FD_SET(sd, &rfds); in channel_connect()
811 FD_SET(sd, &wfds); in channel_connect()
821 ret = select((int)sd + 1, &rfds, &wfds, NULL, &tv); in channel_connect()
828 sock_close(sd); in channel_connect()
835 if (FD_ISSET(sd, &wfds)) in channel_connect()
851 if (FD_ISSET(sd, &rfds) || FD_ISSET(sd, &wfds)) in channel_connect()
853 ret = getsockopt(sd, in channel_connect()
867 sock_close(sd); in channel_connect()
873 sock_close(sd); in channel_connect()
878 if (FD_ISSET(sd, &wfds) && so_error == 0) in channel_connect()
916 sock_close(sd); in channel_connect()
924 ioctlsocket(sd, FIONBIO, &val); in channel_connect()
926 (void)fcntl(sd, F_SETFL, 0); in channel_connect()
930 return sd; in channel_connect()
947 int sd = -1; in channel_open() local
1036 sd = channel_connect(channel, addr->ai_addr, (int)addr->ai_addrlen, in channel_open()
1038 if (sd >= 0) in channel_open()
1071 sd = channel_connect(channel, (struct sockaddr *)&server, sizeof(server), in channel_open()
1075 if (sd < 0) in channel_open()
1083 channel->CH_SOCK_FD = (sock_T)sd; in channel_open()