#include <TcpServerSocket.hpp>
Inheritance diagram for TcpServerSocket::
Public Methods | |
TcpServerSocket (int port=0, int backlog=4) throw (int) | |
TcpServerSocket (TcpServerSocket &original) throw (int) | |
TcpServerSocket (InetAddress &address, int port=0, int backlog=4) throw (int) | |
InetAddress | getInetAddress () |
int | getLocalPort () |
int | setSoTimeout (int timeout) |
int | getSoTimeout () |
Protected Attributes | |
int | localPort |
|
Definition at line 15 of file TcpServerSocket.cpp. 00016 : ServerSocket((struct sockaddr *)NULL, PF_INET, SOCK_STREAM, 0) 00017 { 00018 struct sockaddr_in *s_in; 00019 lsa= &local_sa; 00020 s_in = (struct sockaddr_in *) &local_sa; 00021 localPort = port; 00022 s_in->sin_family = AF_INET; 00023 s_in->sin_port = htons(port); 00024 s_in->sin_addr.s_addr = htonl(INADDR_ANY); 00025 memset(&(s_in->sin_zero), '\0', 8); 00026 sleep(2); 00027 bind(); 00028 ::listen(sck, backlog); 00029 } |
|
Definition at line 31 of file TcpServerSocket.cpp. 00032 : ServerSocket((struct sockaddr *)NULL, PF_INET, SOCK_STREAM, 0) 00033 { 00034 00035 } |
|
Definition at line 37 of file TcpServerSocket.cpp. 00038 : ServerSocket((struct sockaddr *)NULL, PF_INET, SOCK_STREAM, 0) 00039 { 00040 struct sockaddr_in *s_in = (struct sockaddr_in *)lsa; 00041 localPort = port; 00042 s_in->sin_family = AF_INET; 00043 s_in->sin_port = htons(localPort); 00044 s_in->sin_addr.s_addr = address.getAddress2(); 00045 memset(&(s_in->sin_zero), '\0', 8); 00046 bind(); 00047 ::listen(sck, backlog); 00048 } |
|
Definition at line 54 of file TcpServerSocket.cpp. 00055 { 00056 InetAddress I(inet_ntoa(((struct sockaddr_in*)lsa)->sin_addr)); 00057 return I; 00058 } |
|
Definition at line 60 of file TcpServerSocket.cpp. 00061 { 00062 return localPort; 00063 } |
|
Definition at line 79 of file TcpServerSocket.cpp. 00080 { 00081 return -1; 00082 } |
|
Definition at line 65 of file TcpServerSocket.cpp. 00066 { 00067 #if 0 00068 if(setSockOpt(SOL_ServerSocket,SO_TIMEOUT,(void *)&timeout,sizeof(int)) != 0) 00069 return -1; 00070 // perror("TcpServerSocket::setSoTimeout() FAIL"); 00071 00072 return 0; 00073 #else 00074 errno = EBADF; 00075 return -1; 00076 #endif 00077 } |
|
Definition at line 44 of file TcpServerSocket.hpp. |