TCP connection with VB6 App

KZero

Active Member
Licensed User
Longtime User
Hello,
at the beginning i would like to thank everyone worked in this great app "B4A"

finally i could make TCP connection from Android to my VB6 App. :sign0060:

it works gr8 only if i'm sending and receiving plain text
VB6 uses ANSI encoding while i use in B4A "Windows-1256" charset (to show Arabic characters)

i use custom encryption logarithm i wrote in VB6 and i could convert it to work with B4A

the problem now is : when i send encrypted string from Android to the VB App it can't decrypt it correctly
also the same when i send the string from the VB to android
how ever when i encrypt and decrypt the string from android alone it works

i know that the problem because of the encoding but i don't have any idea how to fix it

any ideas are much appreciated :sign0085:
thanks in advance
 

JoeJoe123

Member
Licensed User
Longtime User
rbsoft, thank you for your answers. It worked with your guys help.

Here is what I did. On the PC I shut off windows firewall.(the modem off just to be safe)
I left the port set to 81. Bam connected.

So then I turned on Windows Firewall and under Exceptions tab I clicked Add Program.
The program I entered was the vb6 app that was running the winsock component.

This now lets me connect the two apps with the firewall on and without opening
a port. I think because did you say port 81 is normally closed? And is just allowing my
specific app permission better or safer then opening a port?

Thanks again
 
Upvote 0

Thusing

New Member
i cant connect my android to a vb6 project

hey! sorry for answering an old thread...
but i want an example to connect my b4a client, to a vb6 server.
I want an example code for VB6...

i tryed with a vb6 socket and a winsock but in my b4a client, i got the error connecting message.


I just have my vb6 server (its a game), and the vb6 client also exists, but i'm programming the client in b4a, to connect it to these vb6 server.
But i get the error message,, socket doesn't connect :(

Sorry for my bad English.
 
Upvote 0

mbatgr

Active Member
Licensed User
Longtime User
Hi Rolf,
I use your code to communicate with VB6 app sending codes from tablet client to it. Have you found any way to manage the situation where multiple messages are received as one?

...this situation happens to me in a sudden with certain messages which have no obvious differences with the others that everything works ok. Or have you implemented "prefix mode" in VB6 or does it exist a VB6 code?
thaniking you in advanced
 
Upvote 0

rbsoft

Active Member
Licensed User
Longtime User
I am not using the prefix mode for something of that sort does not exist in VB6. I am using my own protocol to filter the incoming messages. Basically very simple - each message starts with a start sequence and ends with an end delimiter.

Example:
I want to send a text message to the server with the message "Hello".
I would send then the "&&MS" (the start sequence), "Hello" (the message), and char(0) (the end delimiter).
The server filters the raw message out.

I am continueing using this because a have a commercial software on the market and it would be difficult to change it now. It is a suite of programs that consists of programs written in VB6, PowerBasic, Embedded VisualBasic, VB2005, and B4A.

For new projects I would by all means use the prefix mode.

Rolf
 
Upvote 0

mbatgr

Active Member
Licensed User
Longtime User
I think that is even simpler than that. I just add an "EOT" at the end of each message and then in new DataArrival I use that character to separate the messages in case that there are send multiple messages instead of one by one. No SOT, no ACK!
 
Upvote 0

M.LAZ

Active Member
Licensed User
Longtime User
Hi Guys,,,
is there any sample code in vb6 to send /receive data .
and how long is the string or msg to send?
 
Upvote 0
Top