Jump to content

au3xtra.dll and function problem


Recommended Posts

I am creating a yahoo chat client, just a couple of questions.

Is there a packet length limit for the $str variable when using:

$ret = DLLCall("au3xtra.dll", "int", "TCPSend", "int", $socket, "str", $str)

If so, do I have to split my packet up and then send them one after the other.

Does the same apply for the "TCPRecv" function:

$ret = DLLCall("au3xtra.dll","int","TCPRecv", "int", $socket, "str", "", "int", $packetSize)

I see 512 alot, so I create the following function:

Func parsePacket($socket)

Const $packetSize = 512

Dim $packetArray[1]

$ret = DLLCall("au3xtra.dll","int","TCPRecv", "int", $socket, "str", "", "int", $packetSize)

While StringLen($ret[2]) > 0

_ArrayAdd($packetArray, $ret[2])

$ret = DLLCall("au3xtra.dll","int","TCPRecv", "int", $socket, "str", "", "int", $packetSize)

WEnd

return $packetArray

EndFunc

Is there a easier way to do this?

Lastly, as there is no code for a yahoo client in autoit, I am translating it from VB6

Is anyone able to tell me if the following translation is correct as it does not work for me:

VB6

===

Public Function CalcSize(PckLen As Integer) As String

CalcSize = Chr$(Int(PckLen / 256)) & Chr$(Int(PckLen Mod 256))

End Function

Autoit

====

Func calcSize($packetLength)

$calcSize = Chr(Int($packetLength / 256)) & Chr(Int(Mod($packetLength, 256)))

Return $calcSize

EndFunc

I have attached a copy of the client so far if you wish to see the details

Thanks a lot

Link to comment
Share on other sites

I am creating a yahoo chat client, just a couple of questions.

Have you checked out the yahoo developer network - they have released a wide variety of apis / dlls that may obsolete your approach ( or may not, i haven't had the need to look at them closely yet. ).

Reading the help file before you post... Not only will it make you look smarter, it will make you smarter.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...