Click here to Skip to main content
15,908,581 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Closing dialog correctly Pin
jimNLX25-Jul-02 8:00
jimNLX25-Jul-02 8:00 
QuestionAdding a Menu? Pin
Rene De La Garza19-Jul-02 7:56
Rene De La Garza19-Jul-02 7:56 
Generaladding service features Pin
s_k19-Jul-02 7:49
s_k19-Jul-02 7:49 
GeneralRe: adding service features Pin
l a u r e n19-Jul-02 10:46
l a u r e n19-Jul-02 10:46 
GeneralWebCam and SoundBoard Detection Pin
Anonymous19-Jul-02 7:43
Anonymous19-Jul-02 7:43 
GeneralRe: WebCam and SoundBoard Detection Pin
Ernest Laurentin19-Jul-02 10:01
Ernest Laurentin19-Jul-02 10:01 
GeneralGetting IP from client socket Pin
s_k19-Jul-02 7:40
s_k19-Jul-02 7:40 
GeneralRe: Getting IP from client socket Pin
Bubba214619-Jul-02 8:03
Bubba214619-Jul-02 8:03 
s_k wrote:
How can I get IP address from client socket which I accepted ??

With Berkeley sockets you need to pass a sockaddr_in struct to your accept() call like so:
<br />
struct sockaddr_in their_addr; /* connector's address information */<br />
<br />
/* create a socket and call bind() and listen() */<br />
<br />
sin_size = sizeof(struct sockaddr_in);<br />
new_fd = accept(sockfd, &their_addr, &sin_size);<br />

Upon connection you can read the values from the their_addr struct and get what you need.

As for your other question I personally can't answer it in the context of a forum post. I would just look at how other programs handle rules like that for guidance. It's the kind of thing you can make as complex as you want, but I would really strive for simplicity to reduce logic errors.
GeneralATL Composite Control/keyboard events Pin
nemo19-Jul-02 6:52
nemo19-Jul-02 6:52 
Questionc# ? different from c or c++ ? Pin
includeh1019-Jul-02 6:35
includeh1019-Jul-02 6:35 
AnswerRe: c# ? different from c or c++ ? Pin
Chris Losinger19-Jul-02 6:40
professionalChris Losinger19-Jul-02 6:40 
GeneralRe: c# ? different from c or c++ ? Pin
includeh1019-Jul-02 7:49
includeh1019-Jul-02 7:49 
GeneralRe: c# ? different from c or c++ ? Pin
Navin19-Jul-02 7:52
Navin19-Jul-02 7:52 
QuestionCListView is evil? Pin
Chris Losinger19-Jul-02 6:05
professionalChris Losinger19-Jul-02 6:05 
AnswerRe: CListView is evil? Pin
Rage19-Jul-02 6:20
professionalRage19-Jul-02 6:20 
AnswerRe: CListView is evil? Pin
loket19-Jul-02 6:38
loket19-Jul-02 6:38 
GeneralRe: CListView is evil? Pin
Chris Losinger19-Jul-02 6:41
professionalChris Losinger19-Jul-02 6:41 
AnswerRe: CListView is evil? Pin
Chad Koehler19-Jul-02 9:12
Chad Koehler19-Jul-02 9:12 
GeneralRe: CListView is evil? Pin
Chris Losinger19-Jul-02 9:14
professionalChris Losinger19-Jul-02 9:14 
GeneralHandling events Pin
jparsons19-Jul-02 5:04
jparsons19-Jul-02 5:04 
GeneralRe: Handling events Pin
Nish Nishant19-Jul-02 5:09
sitebuilderNish Nishant19-Jul-02 5:09 
GeneralRe: Handling events Pin
jparsons19-Jul-02 5:12
jparsons19-Jul-02 5:12 
GeneralHandling data files from multiple software versions Pin
David Chamberlain19-Jul-02 5:02
David Chamberlain19-Jul-02 5:02 
GeneralRe: Handling data files from multiple software versions Pin
Rage19-Jul-02 6:34
professionalRage19-Jul-02 6:34 
GeneralRe: Handling data files from multiple software versions Pin
Navin19-Jul-02 6:56
Navin19-Jul-02 6:56 

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.