A question about Network Programming
-
I have a plan to develop a Network Application. Suppose I have a class
CServerData
with a member function likes:CString CServerData::GetString()
Here is a pseudo implementation ofGetString
function: CString CServerData::GetString(){ 1. Connect to Server 2. Send a request to Server 3. Wait until server answer 4. Return a CString }
So that, in anywhere, I can write:CServerData server; CString st=server.GetString();
If I use CSocket, How can I implement that? It is better if you can give me a detail example. Thanks for reading. -
I have a plan to develop a Network Application. Suppose I have a class
CServerData
with a member function likes:CString CServerData::GetString()
Here is a pseudo implementation ofGetString
function: CString CServerData::GetString(){ 1. Connect to Server 2. Send a request to Server 3. Wait until server answer 4. Return a CString }
So that, in anywhere, I can write:CServerData server; CString st=server.GetString();
If I use CSocket, How can I implement that? It is better if you can give me a detail example. Thanks for reading.Why reinvent the wheel? How about just using
NetServerGetInfo(..., 101, ...)
?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)