Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Reading the registry Pin
Shay Harel18-Aug-03 9:09
Shay Harel18-Aug-03 9:09 
GeneralRe: Reading the registry Pin
David Crow18-Aug-03 9:18
David Crow18-Aug-03 9:18 
GeneralRe: Reading the registry Pin
Shay Harel18-Aug-03 10:36
Shay Harel18-Aug-03 10:36 
GeneralRe: Reading the registry Pin
David Crow18-Aug-03 10:44
David Crow18-Aug-03 10:44 
GeneralRe: Reading the registry Pin
Shay Harel18-Aug-03 10:48
Shay Harel18-Aug-03 10:48 
GeneralRe: Reading the registry Pin
David Crow18-Aug-03 10:58
David Crow18-Aug-03 10:58 
GeneralDrag drop from my application to Windows Explorer Pin
Orantho18-Aug-03 7:57
Orantho18-Aug-03 7:57 
GeneralWinSOCK bind function. Pin
Søren Alsbjerg Hørup18-Aug-03 7:23
Søren Alsbjerg Hørup18-Aug-03 7:23 
I'm trying to create a server which accepts client connections.

....
Address.sin_family = AF_INET;
Address.sin_port = htons(1212);
Address.sin_addr.s_addr = htonl(INADDR_ANY);
IntReturn = bind(Listen, (struct sockaddr *) &Address, sizeof(Address));
IntReturn = listen(Listen, 10);
IntReturn = sizeof(RemoteAddress);
Client[Computer].ClientSocket=accept(Listen, (struct sockaddr *) &RemoteAddress, &IntReturn);
...

Clients from any! ip can connect to my server on port 1212..
My server should not accept connections from any ip, so how do I get my server to only accept connections from example 10.0.0.105 ?

I thought about changing this line

Address.sin_addr.s_addr = htonl(INADDR_ANY);

to

Address.sin_addr.s_addr = inet_addr("10.0.0.105");

but this does not work, am I doing something wrong?

Thanks
GeneralRe: WinSOCK bind function. Pin
markkuk18-Aug-03 8:02
markkuk18-Aug-03 8:02 
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 
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 

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.