Thread: CSocketFile

  1. #1
    Unregistered
    Guest

    CSocketFile

    Does anyone know how to pass objects using CArchive from a cleint application to a server application ?

    For example if I wanted to pass int i=100 from one application to the next using a CSocketFile and CArchive objects , how can I do this?

    I've read the MSDN documentation but the data doesn't seem to get through to the next side.
    Can anyone help?

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    32
    I have no idea what CSocketFile or CArchive is... but to do it using C (not C++) you would simply do the following...

    Code:
    int main()
    {
    int i=100;
    char StringtoSend[100];
    
    // Initialize Winsock
    // Connect to server
    
    sprintf(StringtoSend, "%d", i);
    send(socket, StringtoSend, strlen(StringtoSend), 0);
    }
    I'm not sure how to do it with the way you want it to, but thats how I do it and so maybe you can work with it a bit to figure out your problem? I'm not sure.
    cerion
    Use the code Luke.

Popular pages Recent additions subscribe to a feed