Differentiate between browser request and console client request RRS feed

  • Question

  • Hello,

    I have created a Server in C#. But I am not able to differentiate whether requests coming to Server are from Browser or Console application.

    I have to process these requests separately. How can I differentiate these requests? 

    Thank you in advance!

    Best Regards,


    • Edited by NavnathK Monday, December 11, 2017 2:45 PM
    • Moved by Fei Hu Monday, December 25, 2017 6:30 AM
    Monday, December 11, 2017 2:45 PM

All replies

  • This sounds like a web application. Please post questions related to web development in the ASP.NET forums. There is no difference between requests and where they came from beyond the request headers that are sent. 

    Michael Taylor http://www.michaeltaylorp3.net

    Monday, December 11, 2017 7:19 PM
  • Hi,

    I think you are confused about HTTP and Socket .

    HTTP protocol is a non-persistent, one-way network protocol that allows the server to return the appropriate data only after the browser has made a request to the server to establish the connection.

    HTTP connection using the "request - response" approach.

    HTTP  is a short connection: the client sends the request needs to send back the server response, after the request is completed, it takes the initiative to release the connection.

    Socket is wrapped the TCP / IP protocol , Socket is only an interface is not a protocol, we can use Socket TCP / IP protocol, in addition to TCP, you can use the UDP protocol to transfer data.

    Socket is a long connection: Once the Socket connection is established, the two parties in the communication start to send each other's data until they are disconnected.

    In many cases, it is necessary to actively push data from the server to the client and keep the client and the server in real time.

    If the two sides are Socket connection, the server can send data directly to the client.

    If the two sides are HTTP connections, the server needs to wait for the client to send the request before the data can be returned to the client.

    Therefore, the client sends requests to the server regularly, not only can stay online, but also ask the server whether there is new data, if there is data to the client.



    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, December 14, 2017 6:11 AM