7 Method Winsock Control

Diposting oleh Admin | Monday, June 30, 2008 | , | 0 komentar »

There is seven method had Winsock control. You can it mentioning As command is available on winsock control.

Accept
This method function for received a connection which want correlate owning ID which conceived of RequestID( data type as long)

Syntax:
object.Accept requestID

Ex:
Private subwinsock1_connectionRequest(byVal request_ID as long)
'received connection
winsock1.accept requestID
end sub

In general this method is used at event object_dataArrival

Bind
This method only functioning for the binding of LocalPort and localIp will be used on conecttion using protocol TCP/IP. In general this method less many used.Except your computer used more then 1 protocol adapter (example TCP/IP and NWlink or IPX/SPX)

Syntax:
object.bind localPort, LocalIP

ex:
Winsock1.blind 1023,"202.155.10.1"

Close
this method function dor close active connection

syntax:
object.close
ex:
Winsock1.close

GetData
This method function for received data from server to client

syntax:
object.GetData Variable.[type].[data length]

ex:
winsock1.Getdata VarStr

Listen
This method function for made winsock control on mode "Listening", Winsock control ready receive new conection on defintion port.

syntax:
object.listen
ex:
winsock1.listen

PeekData
This method funtion like GetData method, but PeekData not delete data in buffer. this method rather seldom to bes used because data from buffer will continued increasing with increase data traffic and not delete.

syntax:
object.peekData variable,[type],[data length]
ex:
winsock1.PeekData VarStr

SendData
This method representing one of method what most often used. this function for send data to computer target.

Syntax:
object.SendData Variable

ex:
winsock1.SendData "Your Data String"

0 komentar