-
Apr 16th, 2020, 11:57 PM
#41
Last edited by couttsj; Apr 17th, 2020 at 12:00 AM.
-
Dec 15th, 2021, 05:21 PM
#42
Addicted Member
Re: VB6 - Simple Sock
Any chance you could help me determine why I am not receiving my data when i connect to a device? Here is the scenario I have a zebra printer device that i am connecting to on port 6101. Once connected, I can send a command to the printer and receive data back UNLESS I am just querying a single setting. In order to get all the settings I send ! U1 getvar "allcv" if I query one setting from the printer ! U1 getvar "ip.mirror.server" i get nothing UNLESS i send an allcv command right afterwards. On your previous version this worked fine. I could send and receive both all the data or a single message. I have noticed that it seems to be holding on to the data even though its not showing the response. If i send an ALLCV query to the printer right after sending a query for a single setting it responds with the single setting query first and then all of the data that follows from the ALLCV.
When i send the ALLCV (! U1 getvar "allcv") which is the command to get all of the data, I see in the debug window
OK SubClass Initialized!
Winsock buffer size for sends: 65536
Winsock buffer size for receives: 64512
OK Created socket collection
OK Created winsock message window 791606
OK Registered events from socket 2696
FD_CONNECT 2696
STATE: sckConnected
FD_WRITE 2696
OK Bytes sent: 21
OK Finished SENDING
FD_READ 2696
OK Bytes obtained from buffer: 924
FD_READ 2696
OK Bytes obtained from buffer: 866
FD_READ 2696
OK Bytes obtained from buffer: 5554
FD_READ 2696
OK Bytes obtained from buffer: 11446
FD_READ 2696
OK Bytes obtained from buffer: 27292
OK Destroyed winsock message window 791606
OK Destroyed socket collection
STATE: sckClosed
OK Winsock Service Terminated!
OK Freed subclass memory at: 980000
OK SubClass Finalized!
If I send the single query (! U1 getvar "ip.mirror.server") I see:
OK SubClass Initialized!
Winsock buffer size for sends: 65536
Winsock buffer size for receives: 64512
OK Created socket collection
OK Created winsock message window 397854
OK Registered events from socket 2844
FD_CONNECT 2844
STATE: sckConnected
FD_WRITE 2844
OK Bytes sent: 32
OK Finished SENDING
FD_READ 2844
OK Bytes obtained from buffer: 11
OK Destroyed winsock message window 397854
OK Destroyed socket collection
STATE: sckClosed
OK Winsock Service Terminated!
OK Freed subclass memory at: 2470000
OK SubClass Finalized!
-
I suspect I am receiving too little data and its not showing it to me but I have no idea where to look.
Last edited by brandoncampbell; Dec 15th, 2021 at 05:51 PM.
-
Dec 15th, 2021, 09:27 PM
#43
Addicted Member
Re: VB6 - Simple Sock
G'Day JAC
Originally Posted by couttsj
I search this web page for jcrypt.dll - only in above URL
I search the web for jcrypt.dll - no joy for a download URL
How do I get this .dll as this URL is 404 ???
-
Dec 16th, 2021, 11:19 AM
#44
Re: VB6 - Simple Sock
Originally Posted by brandoncampbell
Any chance you could help me determine why I am not receiving my data when i connect to a device? Here is the scenario I have a zebra printer device that i am connecting to on port 6101. Once connected, I can send a command to the printer and receive data back UNLESS I am just querying a single setting. In order to get all the settings I send ! U1 getvar "allcv" if I query one setting from the printer ! U1 getvar "ip.mirror.server" i get nothing UNLESS i send an allcv command right afterwards. On your previous version this worked fine. I could send and receive both all the data or a single message. I have noticed that it seems to be holding on to the data even though its not showing the response. If i send an ALLCV query to the printer right after sending a query for a single setting it responds with the single setting query first and then all of the data that follows from the ALLCV.
When i send the ALLCV (! U1 getvar "allcv") which is the command to get all of the data, I see in the debug window
I suspect I am receiving too little data and its not showing it to me but I have no idea where to look.
You are obviously sending and receiving data. You are just not reacting to it properly. You sent 21 bytes, and the other end sent 924, 866, 5554, 11446, and 27292 bytes in separate packets. You can find out what is in those packets by enabling the "DebugPrintByte" routine in the DataArrival sub.
Code:
bData = mClient.bInBuffer
'Call DebugPrintByte("bData", bData)
Call AddByte(InBuff, bData) 'Add incoming data to buffer
Then you can figure out how to handle the incoming byte data, as I have no idea what format it is in.
J.A. Coutts
-
Dec 16th, 2021, 11:32 AM
#45
Re: VB6 - Simple Sock
Originally Posted by jg.sa
G'Day JAC
I search this web page for jcrypt.dll - only in above URL
I search the web for jcrypt.dll - no joy for a download URL
How do I get this .dll as this URL is 404 ???
The "yellowhead.com" domain name does not belong to me anymore. However, for as long as it lasts, it can still be reached at "http://96.53.96.50/yellowhead/documents/jcrypt.dll".
J.A. Coutts
-
Dec 17th, 2021, 09:34 AM
#46
Addicted Member
Re: VB6 - Simple Sock
Originally Posted by couttsj
You are obviously sending and receiving data. You are just not reacting to it properly. You sent 21 bytes, and the other end sent 924, 866, 5554, 11446, and 27292 bytes in separate packets. You can find out what is in those packets by enabling the "DebugPrintByte" routine in the DataArrival sub.
Code:
bData = mClient.bInBuffer
'Call DebugPrintByte("bData", bData)
Call AddByte(InBuff, bData) 'Add incoming data to buffer
Then you can figure out how to handle the incoming byte data, as I have no idea what format it is in.
J.A. Coutts
I am confused at the statement of what format it would be in. Its the same format as the previous command I call it's just it has more data. Its def getting the information - when i added the debug I get the return 22 61 6C 6C 22 which equates to "all" Nothing special about it and still not sure why it wouldn't show that in the text window.
Last edited by brandoncampbell; Dec 17th, 2021 at 10:10 AM.
-
Dec 17th, 2021, 12:06 PM
#47
Addicted Member
Re: VB6 - Simple Sock
Originally Posted by brandoncampbell
I am confused at the statement of what format it would be in. Its the same format as the previous command I call it's just it has more data. Its def getting the information - when i added the debug I get the return 22 61 6C 6C 22 which equates to "all" Nothing special about it and still not sure why it wouldn't show that in the text window.
Actually, somewhat got it.
lPntr = InStr(InBuff, vbCrLf)
It seems that you are looking for vbCrlf and in this case it's one line with no carriage return. So it looks like lPntr = Len(InBuff) fixes it but I am not sure this is the best course of action.
Last edited by brandoncampbell; Dec 17th, 2021 at 12:11 PM.
-
Dec 17th, 2021, 12:21 PM
#48
Re: VB6 - Simple Sock
Originally Posted by brandoncampbell
Actually, somewhat got it.
lPntr = InStr(InBuff, vbCrLf)
It seems that you are looking for vbCrlf and in this case it's one line with no carriage return.
Now, I have to determine the best course of action.
Data normally requires a header, or at the very least some kind of End-Of-Data. In the world of HTML, the header is a variable length defined by ending in a double CrLF. More often that not, the header is a fixed length and defines the length of the data to be received.
J.A. Coutts
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|