Advertisement

10.05.2008 at 09:24PM PDT, ID: 23789491 | Points: 200
[x]
Attachment Details

Winsock problems

Asked by POSiTrack in WInsock, Visual Basic v1.0.5.x, Microsoft Programming

Tags: , ,

I am attempting to send an XML string to an IP address using winsock.  Specifically 127.0.0.1 port 1010.  When I send a text file it works properly but when I try to create the same file in a text box or in a procedure it doesn't work.  I am attaching the VB6 app I am trying to use.  The XML string I am creating is the same as in the text file on C:.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
Dim strFile As String, strXML As String
strXML = "<ParataRds_Msg>"
strXML = strXML & "<Msg_Header>"
strXML = strXML & "<Version>6.6</Version>"
strXML = strXML & "<Msg_ID>foo</Msg_ID>"
strXML = strXML & "<MsgType>REQUEST</MsgType>"
strXML = strXML & "<RequestType>GetAllNdcStatus</RequestType>"
strXML = strXML & "</Msg_Header>"
strXML = strXML & "</ParataRds_Msg>"
strFile = strXML
'strFile = "C:\GetAllNDC.txt"
    Dim Buffer() As Byte, P As Long, strData As String
    iFileNum = FreeFile
    Open strFile For Binary Access Read Lock Write As iFileNum
    ReDim Buffer(lngMIN(LOF(iFileNum), PacketSize) - 1)
    Get iFileNum, , Buffer ' read data
    SckSendFile.SendData CStr(LOF(iFileNum)) & ","  
    P = InStrRev(strFile, "\")
    SckSendFile.SendData Mid(iFileNum, P + 1) & ":" 
    SckSendFile.SendData Buffer
 
Loading Advertisement...
 
[+][-]10.15.2008 at 05:50AM PDT, ID: 22720337

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628