nih gw bawain pengganti winsock d vb yaitu socket C
CSocketMaster
=============================
*** What is CSocketMaster?
==========================
CSocketMaster class is a Winsock control substitute that attempts to mimic it's behavior and interface to make it easy to implement.
(katanya soket C mudah untuk d implementasikan )
*** How do you use it?
======================
1) Add CSocketMaster.cls and modSocketMaster.bas to your project.
(mudah cara gunain ny tgl tambahin class dan module soket c k dalam project lo )
2) In a Form, Class or UserControl add this line in the declaration area for each socket you want to use:
(selanjut na lo deklarasiin dlu stiap soket yg mo lo gunain nah ini tmsk beda ama winscok vb )
Dim WithEvents NameOfSocket As CSocketMaster
where 'NameOfSocket' is any name you want for the socket.
3) Finally you need to create the object before using it. Add this line in a sub or funtion:
(stlah ntu lo harus create dlu object na sblun gunain soket na.. cara ny mudah koq tgl tambahin d sub, function klo gw bwt ny d form load )
Set NameOfSocket = New CSocketMaster
That's it.
*** Differences between CSocketMaster and Winsock control
=========================================================
nah ini perbedaan ny ama winsock.. tp tenang aj ini hanya penulisan nama aj.. setiap fungsi ny sama koq
A) Winsock Close function is CloseSck in CSocketMaster.
B) Winsock Close event is CloseSck in CSocketMaster.
C) WndProc function is used to deliver system messages and you should not call it under any circumstance.
D) There are some other differences I intentionally put in CSocketMaster that you shouldn't notice. If you find a major difference that you think shouldn't be there, please let me know.
*** Known issues
================
A) Msgbox
Due to a VB behavior by desing running a project in the IDE that displays a message box created with Msgbox prevents events from occurring. If you really need to use message boxes then you can use MessageBox api instead. Note that this only happens in the IDE, when you compile your project all events are fired no matter what. For more info check this site:
*** Why not use Winsock control?
================================
Bacause winsock it's a fixed non-modifiable control. Also it is known that Winsock has a memory leak. For more info check this site:
*** Why use a class instead of a control?
=========================================
Using a class instead of a control has some clear benefits. You have total encapsulation, and you could, for example, make a class (or control) that downloads files from internet just passing a URL without knowing how CSocketMaster works internally. You can modify CSocketMaster and add more fancy functions and events. Best of all: you don't have external dependencies.
(rasain sendiri yag benefit ny )
*** Why use a control instead of a class?
=========================================
There's a Winsock control clone as part of the sample projects. With a control you can build arrays and create sockets at runtime easier.
(bs jg d jadiin array )
*** Why so many Debug logs?
===========================
That's for helping me (and you) to find any possible bug. If you get annoyed you can always erase them or comment them.
(nah asik na debug na d ksh tw.. jd lo bs temuin yg eror dmna ato klo gag ska tgl d jd in komen )
*** What's new on 1.3?
======================
* Fixed the bug that wouldn't free listening socket when the end button is pressed
* Now the use of breakpoints doesn't stop the socket messages
* Minor bugs.
baca aj yag
CSocketMaster
=============================
*** What is CSocketMaster?
==========================
CSocketMaster class is a Winsock control substitute that attempts to mimic it's behavior and interface to make it easy to implement.
(katanya soket C mudah untuk d implementasikan )
*** How do you use it?
======================
1) Add CSocketMaster.cls and modSocketMaster.bas to your project.
(mudah cara gunain ny tgl tambahin class dan module soket c k dalam project lo )
2) In a Form, Class or UserControl add this line in the declaration area for each socket you want to use:
(selanjut na lo deklarasiin dlu stiap soket yg mo lo gunain nah ini tmsk beda ama winscok vb )
Dim WithEvents NameOfSocket As CSocketMaster
where 'NameOfSocket' is any name you want for the socket.
3) Finally you need to create the object before using it. Add this line in a sub or funtion:
(stlah ntu lo harus create dlu object na sblun gunain soket na.. cara ny mudah koq tgl tambahin d sub, function klo gw bwt ny d form load )
Set NameOfSocket = New CSocketMaster
That's it.
*** Differences between CSocketMaster and Winsock control
=========================================================
nah ini perbedaan ny ama winsock.. tp tenang aj ini hanya penulisan nama aj.. setiap fungsi ny sama koq
A) Winsock Close function is CloseSck in CSocketMaster.
B) Winsock Close event is CloseSck in CSocketMaster.
C) WndProc function is used to deliver system messages and you should not call it under any circumstance.
D) There are some other differences I intentionally put in CSocketMaster that you shouldn't notice. If you find a major difference that you think shouldn't be there, please let me know.
*** Known issues
================
A) Msgbox
Due to a VB behavior by desing running a project in the IDE that displays a message box created with Msgbox prevents events from occurring. If you really need to use message boxes then you can use MessageBox api instead. Note that this only happens in the IDE, when you compile your project all events are fired no matter what. For more info check this site:
- Code:
http://support.microsoft.com/default.aspx?scid=kb;en-us;178078
*** Why not use Winsock control?
================================
Bacause winsock it's a fixed non-modifiable control. Also it is known that Winsock has a memory leak. For more info check this site:
- Code:
http://support.microsoft.com/default.aspx?scid=kb;en-us;171843
*** Why use a class instead of a control?
=========================================
Using a class instead of a control has some clear benefits. You have total encapsulation, and you could, for example, make a class (or control) that downloads files from internet just passing a URL without knowing how CSocketMaster works internally. You can modify CSocketMaster and add more fancy functions and events. Best of all: you don't have external dependencies.
(rasain sendiri yag benefit ny )
*** Why use a control instead of a class?
=========================================
There's a Winsock control clone as part of the sample projects. With a control you can build arrays and create sockets at runtime easier.
(bs jg d jadiin array )
*** Why so many Debug logs?
===========================
That's for helping me (and you) to find any possible bug. If you get annoyed you can always erase them or comment them.
(nah asik na debug na d ksh tw.. jd lo bs temuin yg eror dmna ato klo gag ska tgl d jd in komen )
*** What's new on 1.3?
======================
* Fixed the bug that wouldn't free listening socket when the end button is pressed
* Now the use of breakpoints doesn't stop the socket messages
* Minor bugs.
baca aj yag