CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2001
    Posts
    401

    Read data form socket

    I have an application that after being started send all the messages that it generates to a UDP socket created on port 7865.

    Now I have to write a logger function which reads all these messages and saves them into a file as well as displays them.

    The data is sent as a struct of the form

    typeded struct{
    int task,len,type,resource;
    } Resc;


    please help

  2. #2
    Join Date
    Oct 2002
    Location
    Tx, US
    Posts
    208
    From ur post I am not sure what exactly ur problem is & what do u want.
    From ur post it seems u want to create some king of logging mechanism where client going to send some specific message to server & server going to log that message in some data store.

    quote:
    ------------------------------------------------------------------------------------
    I have an application that after being started send all the messages that it generates to a UDP socket created on port 7865.
    ------------------------------------------------------------------------------------
    I really didnt get what ur mentioning here.
    I think ur data sending application is going to act as client then i think that doesn't matter on what port r u creating a socket

    quote:
    ------------------------------------------------------------------------------------
    Now I have to write a logger function which reads all these messages and saves them into a file as well as displays them
    ------------------------------------------------------------------------------------
    i dont think so its good idea to combine the logging & displaying logic in one place
    its better if separate this functionality create 2 diff. application.

    The general architecture should be something like this
    there is going to 3 application
    1)Client: which is going to send the messages to log
    2)Server: which is going to listen (waiting for messages from client) on particular port & going to log the messages
    3)UI: which is going to read the logged messages & display it

    u can lot of info about general client server apps on net.

    HTH
    Vinod

  3. #3
    Join Date
    Feb 2002
    Posts
    5,757
    Post a specific question.

    In short, you will use WSARecv() or recv().

    Kuphryn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured