Lines Matching refs:fd_
299 fd_ = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); in InitTcpWebSocket()
300 if (fd_ < SOCKET_SUCCESS) { in InitTcpWebSocket()
306 if ((setsockopt(fd_, SOL_SOCKET, SO_REUSEADDR, in InitTcpWebSocket()
309 close(fd_); in InitTcpWebSocket()
310 fd_ = -1; in InitTcpWebSocket()
315 if (!SetWebSocketTimeOut(fd_, timeoutLimit)) { in InitTcpWebSocket()
317 close(fd_); in InitTcpWebSocket()
318 fd_ = -1; in InitTcpWebSocket()
326 … if (bind(fd_, reinterpret_cast<struct sockaddr*>(&addr_sin), sizeof(addr_sin)) < SOCKET_SUCCESS) { in InitTcpWebSocket()
328 close(fd_); in InitTcpWebSocket()
329 fd_ = -1; in InitTcpWebSocket()
332 if (listen(fd_, 1) < SOCKET_SUCCESS) { in InitTcpWebSocket()
334 close(fd_); in InitTcpWebSocket()
335 fd_ = -1; in InitTcpWebSocket()
353 if ((client_ = accept(fd_, nullptr, nullptr)) < SOCKET_SUCCESS) { in ConnectTcpWebSocket()
356 close(fd_); in ConnectTcpWebSocket()
357 fd_ = -1; in ConnectTcpWebSocket()
366 close(fd_); in ConnectTcpWebSocket()
367 fd_ = -1; in ConnectTcpWebSocket()
380 fd_ = socket(AF_UNIX, SOCK_STREAM, 0); // 0: defautlt protocol in InitUnixWebSocket()
381 if (fd_ < SOCKET_SUCCESS) { in InitUnixWebSocket()
386 if (!SetWebSocketTimeOut(fd_, timeoutLimit)) { in InitUnixWebSocket()
388 close(fd_); in InitUnixWebSocket()
389 fd_ = -1; in InitUnixWebSocket()
396 close(fd_); in InitUnixWebSocket()
397 fd_ = -1; in InitUnixWebSocket()
403 close(fd_); in InitUnixWebSocket()
404 fd_ = -1; in InitUnixWebSocket()
409 …if (bind(fd_, reinterpret_cast<struct sockaddr*>(&un), static_cast<int32_t>(len)) < SOCKET_SUCCESS… in InitUnixWebSocket()
411 close(fd_); in InitUnixWebSocket()
412 fd_ = -1; in InitUnixWebSocket()
415 if (listen(fd_, 1) < SOCKET_SUCCESS) { // 1: connection num in InitUnixWebSocket()
417 close(fd_); in InitUnixWebSocket()
418 fd_ = -1; in InitUnixWebSocket()
436 if ((client_ = accept(fd_, nullptr, nullptr)) < SOCKET_SUCCESS) { in ConnectUnixWebSocket()
439 close(fd_); in ConnectUnixWebSocket()
440 fd_ = -1; in ConnectUnixWebSocket()
449 shutdown(fd_, SHUT_RDWR); in ConnectUnixWebSocket()
450 close(fd_); in ConnectUnixWebSocket()
451 fd_ = -1; in ConnectUnixWebSocket()
479 shutdown(fd_, SHUT_RDWR); in Close()
481 close(fd_); in Close()
482 fd_ = -1; in Close()