Lines Matching refs:socket_fd
174 int socket_fd = socket(AF_BLUETOOTH, SOCK_RAW, BTPROTO_HCI); in ConnectToSocket() local
175 if (socket_fd < 1) { in ConnectToSocket()
183 ::close(socket_fd); in ConnectToSocket()
192 if (bind(socket_fd, (struct sockaddr*)&addr, sizeof(addr)) < 0) { in ConnectToSocket()
194 ::close(socket_fd); in ConnectToSocket()
198 return socket_fd; in ConnectToSocket()
207 int socket_fd = socket(AF_INET, SOCK_STREAM, 0); in ConnectToSocket() local
208 if (socket_fd < 1) { in ConnectToSocket()
226 int result = connect(socket_fd, (struct sockaddr*)&serv_addr, sizeof(serv_addr)); in ConnectToSocket()
236 int ret = setsockopt(socket_fd, SOL_SOCKET, SO_RCVTIMEO, &socket_timeout, sizeof(socket_timeout)); in ConnectToSocket()
241 return socket_fd; in ConnectToSocket()