allow incomming connections 
Author Message
 allow incomming connections

Hello every one

How can I make my program allow incomming connections to
windows.



Fri, 10 Jun 2005 16:05:15 GMT  
 allow incomming connections
Do you mean a socket connection?  If yes, consider
Winsock.

Kuphryn



Fri, 10 Jun 2005 18:07:18 GMT  
 allow incomming connections
I presume you mean something like network connections. You should look into asynchronous
sockets using CAsyncScoket. There are good examples on the MSDN. Programming raw WinSock
is very, very painful, and you end up with something that is really not all that good if
you take shortcuts (like using synchronous sockets).

Basically, you do the following:
        Choose a port #, and make sure your program allows it to be
                reconfigured by the user
        Create an asynchronous listener socket that looks for connections
        When the listener socket sees that it can accept a connection
                (the OnAccept handler), perform an Accept operation and
                get an asynchrounous socket to represent that connection
        At this point, you can start using that asynchronous socket to do I/O,
                while the listener socket waits for more connections, OR
        you can create a thread to handle the socket communication while
                the listener socket waits for more connections

I'd suggest not trying the multithread approach at first. I learned how to program
asynchronous sockets fairly quickly using the MSDN examples.
                                        joe

Quote:

>Hello every one

>How can I make my program allow incomming connections to
>windows.

Joseph M. Newcomer [MVP]

Web: http://www3.pgh.net/~newcomer
MVP Tips: http://www3.pgh.net/~newcomer/mvp_tips.htm


Fri, 10 Jun 2005 21:18:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. IP address of Incomming connection

2. Looking for a C library allowing ftp connections

3. I need to trap all incomming serial data

4. Looking for a TRS to capture data incomming COM1

5. CRecordSet class and ODBC connections - Too many connections

6. Connection Points and connection lost – what to do?

7. Dynaset with Bookmarks to SQL Server connection makes a CRecordset connection read-only

8. Connection Manager Default Connection

9. ATL Object inserted in MFC App -> no connection Points Allowed??

10. Only SQL_DRIVER_NOPROMPT is allowed when connection pooling is enabled ?

11. Only SQL_DRIVER_NOPROMPT is allowed when connection pooling is enabled ?

12. Allow Sorting in DataGrid (C#)

 

 
Powered by phpBB® Forum Software