Click here to Skip to main content
15,895,557 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: WinSOCK bind function. Pin
Søren Alsbjerg Hørup18-Aug-03 8:44
Søren Alsbjerg Hørup18-Aug-03 8:44 
GeneralRe: WinSOCK bind function. Pin
Rickard Andersson2018-Aug-03 10:12
Rickard Andersson2018-Aug-03 10:12 
GeneralCHtmlView and TIFF Pin
Archigal18-Aug-03 6:38
Archigal18-Aug-03 6:38 
GeneralRe: CHtmlView and TIFF Pin
Archigal19-Aug-03 7:04
Archigal19-Aug-03 7:04 
Questiondo truetype fonts have a unique ID ? Pin
JP GOBLET18-Aug-03 5:59
JP GOBLET18-Aug-03 5:59 
AnswerRe: do truetype fonts have a unique ID ? Pin
Terry O'Nolley18-Aug-03 13:21
Terry O'Nolley18-Aug-03 13:21 
GeneralRe: do truetype fonts have a unique ID ? Pin
JP GOBLET18-Aug-03 21:31
JP GOBLET18-Aug-03 21:31 
GeneralTo LOCALHOST or not to LOCALHOST Pin
Fei Lok18-Aug-03 5:45
Fei Lok18-Aug-03 5:45 
When I am setting up a listener socket, I found that if I use LOCALHOST with inet_addr, that socket can only accept connections from the local machine as indicated in 1) in the following code. However, if I use the machine name, I can accept connections from anywhere but the local machine, as indicated in 2). My question is, is there a way to set up a listener socket that can accept client connections from anywhere including the local machine? Any help will be appreciated.

if ((phostent_far_Hostent = (struct hostent far*)gethostbyname(getenv("COMPUTERNAME"))) == NULL)
{
return INVALID_SOCKET;
}

ZeroMemory((char*)&sockaddr_in_SockAddr, sizeof(sockaddr_in_SockAddr));
1) sockaddr_in_SockAddr.sin_addr.s_addr = inet_addr(LOCALHOST);
2) CopyMemory((char*)&sockaddr_in_SockAddr.sin_addr, phostent_far_Hostent->h_addr, phostent_far_Hostent->h_length);
sockaddr_in_SockAddr.sin_family = phostent_far_Hostent->h_addrtype;
sockaddr_in_SockAddr.sin_port = htons(int_Port_F);

int_SockAddrStructLen = sizeof (sockaddr_in_SockAddr);

if ((SOCKET_Socket = socket(AF_INET, SOCK_STREAM, 0)) < 1)
{
return INVALID_SOCKET;
}

if (bind(SOCKET_Socket, (struct sockaddr*)&sockaddr_in_SockAddr, sizeof sockaddr_in_SockAddr) != 0)
{
closesocket(SOCKET_Socket);
return INVALID_SOCKET;
}
GeneralRe: To LOCALHOST or not to LOCALHOST Pin
Steve S18-Aug-03 22:27
Steve S18-Aug-03 22:27 
Generalset align for header control Pin
_skidrow_vn_18-Aug-03 5:18
_skidrow_vn_18-Aug-03 5:18 
GeneralRe: set align for header control Pin
David Crow18-Aug-03 9:08
David Crow18-Aug-03 9:08 
GeneralTree Control: add item without an image Pin
heranda200018-Aug-03 5:06
heranda200018-Aug-03 5:06 
GeneralRe: Tree Control: add item without an image Pin
Rage18-Aug-03 5:11
professionalRage18-Aug-03 5:11 
GeneralTraffic Control API Pin
pma18-Aug-03 4:56
pma18-Aug-03 4:56 
GeneralFreeze During Compile Pin
Defiler18-Aug-03 4:36
Defiler18-Aug-03 4:36 
GeneralRe: Freeze During Compile Pin
Maximilien18-Aug-03 5:26
Maximilien18-Aug-03 5:26 
GeneralMultithreaded server, broadcasting to multiple clients Pin
Kuniva18-Aug-03 4:21
Kuniva18-Aug-03 4:21 
GeneralRASENTRY dwAlternateOffset question Pin
bob1697218-Aug-03 4:15
bob1697218-Aug-03 4:15 
Generalprint problem Pin
_crs_18-Aug-03 3:39
_crs_18-Aug-03 3:39 
GeneralRe: print problem Pin
Bernhard18-Aug-03 4:45
Bernhard18-Aug-03 4:45 
GeneralHeader file error .Help experts!!! Pin
rohit.dhamija18-Aug-03 2:15
rohit.dhamija18-Aug-03 2:15 
GeneralRe: Header file error .Help experts!!! Pin
HPSI18-Aug-03 2:43
HPSI18-Aug-03 2:43 
GeneralRe: Header file error .Help experts!!! Pin
David Crow18-Aug-03 9:17
David Crow18-Aug-03 9:17 
GeneralRe: Header file error .Help experts!!! Pin
rohit.dhamija18-Aug-03 18:27
rohit.dhamija18-Aug-03 18:27 
GeneralRe: Header file error .Help experts!!! Pin
David Crow19-Aug-03 7:36
David Crow19-Aug-03 7:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.