Results 1 to 3 of 3

Thread: Sending file chunks and chat messages at the same time

  1. #1

    Thread Starter
    Lively Member vb_paladin's Avatar
    Join Date
    May 2003
    Location
    USA
    Posts
    102

    Sending file chunks and chat messages at the same time

    Hi,

    Is it possible to send file chunks and chat messages at the same time over a single winsock connection?

    I was thinking that I could add a specific label before each file chunk or chat message before it is sent, so the receiving program could use the split function to get the label and determine what to do with the data depending on the label. For example, a file chunk would look like "CHUNK" & "|" & chunk. While a chat message would look like "MESSAGE" & "|" & strMessage. While a program is repeatedly sending file chunks to another computer, how would I send a chat message string in between the time a chunk isn't being sent?

    Are there any other methods of sending file chunks and chat messages at the same time over a single winsock connection?

  2. #2
    Fanatic Member jian2587's Avatar
    Join Date
    Aug 2000
    Location
    I bet u need a fusion powered shuttle to reach my place...
    Posts
    963
    yes it's possible, in fact I'd recommend using tags
    <DATA>datas</DATA><MSG>Messages</MSG>
    or an identifier followed by a long which indicates the length of
    the data,
    or design a special word as end of stream, for example,
    double null character.

    but why would u use one winsock?
    I'dn't recommend that.
    Use two to simplify stuffs.
    ASM,C,C++,BASIC,VB,JAVA,VBS,HTML,ASP,PHP,mySQL,VB.NET,MATLAB
    Programming is fun, but only if you're not on a tight deadline
    So I consider all those working engineers sad people

    VB FTP class
    3 page PHP crash course
    Crash Course on DX9 Managed with VB.NET covering basics till terrain creation

  3. #3
    Super Moderator manavo11's Avatar
    Join Date
    Nov 2002
    Location
    Around the corner from si_the_geek
    Posts
    7,171
    As jian2587 you can send anything you want as long as you know what it is when you recieve it. But I would also recommend to use a second control. It will probably be faster also


    Has someone helped you? Then you can Rate their helpful post.

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