|
-
December 2nd, 2002, 03:49 PM
#1
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
-
December 2nd, 2002, 06:39 PM
#2
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
-
December 2nd, 2002, 08:25 PM
#3
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|