locked
Multi-Threading Asynchronous Socket Programming communicates with BizTalk TCP/IP adapter RRS feed

  • General discussion

  • I have the following scenario :

    I have a console app(let A),in this app I am fetching data from database and sending that data to console app(let B).

    A and B are based on client server socket programming.A and B are communicating on the basis of IP-Address and port No.

    B is sending data to BizTalk request-response TCP/IP receive port.

    BizTalk is accepting data and sending into a send port which is solicit response.Now that send port is sending data to a another console app(let C) through Port No and IP Address.

    App C is giving response to BizTalk Send Port.That data is send back to BizTalk Receive Port.

    BizTalk Receive Port is sending data to App B and App B is sending data to App A.

    It is working fine in synchronous socket programming.

    But Now I have to use asynchronous  socket programming and multiple data is coming from the database at a time.

    How should I handle those data ?

    Which approach should I follow ?

    Can anyone give me some useful link regarding my query .

    Thanks in advance.


    Prakash


    • Edited by Shivay_ Monday, October 6, 2014 7:35 PM
    Monday, October 6, 2014 7:32 PM

All replies

  • Do you really have to use all these sockets?

    What is preventing you from integrating these console apps directly into the BizTalk app?

    Monday, October 6, 2014 8:10 PM
    Moderator
  • Socket is multi-threaded and that is how is should be used. This implies that each connect (an event that occurs when a client connects) should fork off a separate thread to handle that specific connection. That was multiple clients can connect and use the request-response pattern.

    If you want asynchronous then look at a duplex pattern where the client starts a listener and connects to the responder with these details. The client keep this connection open and uses it only for firing requests, the responder uses the listener on the client to connect to and send the responses. This is more tedious as the client has to additionally handle the request-response correlation. This however has nothing to do with multiple clients, the responder will still use some sort a connection specific queue based correlation for a single client, but handle multiple clients through multi-threading.

    If you search on the net of socket programming you would find multiple links or you could look at the Internetworking with TCP/IP series from Douglas Comer on socket programming.

    Regards.

    Tuesday, October 7, 2014 4:19 AM