I am continuing developing a remote administraton program (server/client type program), and I have coded a feature that allows the system administrator to update screenshots of the network in which he controls. I used two basic subroutines that use a common variable (array) called bitBinaryData(). Here they are:
vb Code:
  1. Public Sub BWriteFile(sFilePath As String)
  2.     Dim iFreeFile As Integer
  3.     Kill sFilePath
  4.     On Error Resume Next
  5.     iFreeFile = FreeFile
  6.     Open sFilePath For Binary As #iFreeFile
  7.         Put #iFreeFile, 1, bitBinaryData
  8.     Close iFreeFile
  9. End Sub
  10.  
  11. Public Sub BReadFile(sFilePath As String)
  12.     Dim lFileLength As Long
  13.     Dim iFreeFile As Integer
  14.     lFileLength = FileLen(sFilePath)
  15.     iFreeFile = FreeFile
  16.     ReDim bitBinaryData(1 To lFileLength)
  17.     Open sFilePath For Binary As #iFreeFile
  18.         Get #iFreeFile, 1, bitBinaryData
  19.     Close iFreeFile
  20. End Sub

BReadFile reads a file and saves the binary data in the array bitBinaryData and WriteData writes a file using the data stored in bitBinaryData. I am posting these subroutines for anyones use so, feel free.

Anyway, I want to use a winSock control to send this data from my client programs to the server program, and it seems easy enough, but I want to get some more opinions.

I plan on parsing bitBinaryData (on the client) by taking the first 1500 entries in the array, and coalescing them together (seperated by non-numerical characters) into a string-type array called BDataPacket(). What this does is it puts the data into chunks, ready to be sent to the server.

I will then send the packets to the server (that method is already pretty much worked out) and the server will break them down again into the array bitBinaryData() and then simply write a .bmp file and show it to the server administrator.

I am not sure how big to make the packets though, considering I don't know how much can be transfered over winSock connection, and also how big a string data type can be (I have heard from 32000 chars to 2 gigs... i hope that is not the same or i will feel like a jag-bag). If I can it would be preferable to send one huge string from comp to comp (but keep in mind theat the bmp of a screenshot has just under 4 million byte chunks of data... meaning that the array bitBinaryData() is ReDim'ed to bitBinaryData(1 To 3888054)...)

So, any input on whether this will work and also input on how big I should make the packets of data would be useful, considering I haven't actually tried sending the data from one computer to another just yet... but im sure it it'll end up taking a lot of time

Thanks!