Προς το περιεχόμενο

VB kai sockets


NickTheGreek

Προτεινόμενες αναρτήσεις

Δημοσ.

Gnorizei kaneis pos na steilo byte arrays xrisimopoiontas to winsock?Xrisimopoiontas ton parakato kodika mporo na steilo ta panta ektos apo arrays

 

Public Declare Function recvfrom Lib "wsock32.dll" (ByVal s As Long, buf As Any, ByVal buflen As Long, ByVal flags As Long, from As sockaddr, fromlen As Long) As Long

 

Public Declare Function sendto Lib "wsock32.dll" (ByVal s As Long, buf As Any, ByVal buflen As Long, ByVal flags As Long, to_addr As sockaddr, ByVal tolen As Long) As Long

 

X = sendto(sock, ByVal messagetosend, ByVal Len(messagetosend), 0, tosock, ByVal Len(tosock))

 

X = recvfrom(sock, ByVal message, ByVal Len(message), 0, tosock, Len(tosock))

 

Dokimasa na allakso sta declares to buf se buf().To mono pou petixa itan na katafero na steilo arrays alla na mhn mporo na ta labo giati gia kapoio logo sto X=recvfrom(...) ebgaze sfalma kai mou ekleine thn VB.Ennoeitai oti ta message kai messagetosend ta dilosa proigoumanos os arrays os eksis:

 

Dim messagetosend() as byte

Dim message() as byte

 

Pantos xrisimopoiontas to etoimo winsock.ocx mporo na steilo kai na labo arrays,alla gia diaforous logous den thelo na to xrisimopoiiso.Exo tin ipopsia oti se ayto to ocx anti toy sendto kai tou recvfrom xrisimopoieitai h asynchronous ekdosi tous (WSasendto kai WSaRecvFrom).Isos na xreiazetai kati tetoio alla to kako einai oti den ksero na ta xrisimopoiiso kathos i dilosi tous einai ligaki diaforetiki.

 

Kammia boitheia?

Αρχειοθετημένο

Αυτό το θέμα έχει αρχειοθετηθεί και είναι κλειστό για περαιτέρω απαντήσεις.

  • Δημιουργία νέου...