Author | Message | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Corayzon Regular Posts: 67 | A socket is a device that is able to use a connection to connect to another socket. A socket can act like a server where it can listen for other sockets trying to connect to it. Or a socket can act as a client, where it connects to another socket that is listening. Now we understand how a socket makes a connection we can then start to send data through it. We can send data through a connection in two ways. We can send raw binary or simple strings ("$MSG hello mate!|"). So the idea involved in socket programming is that we have a client connecting to a server, to then which the server and clients can send and handle eachothers data to achieve something like sending chat, files or even. more to come soon =] | ||||||||||||
C0D3Z3R0 Pro Posts: 166 | *waits for more* | ||||||||||||
Exile n00b Posts: 30 | I've been looking over socket programming, and found it really interesting I started work with Shad_dow on his latest Ptokax script, Therapy-XS, hmmm what would be a good way to let users update the script withought combing the LUA forum??? So I decided to design and implement my own version of LiveUpdate, the update software from Symantec ;) And here it is, well one screenshot of it 8-), but it's finished and Beta testing has begun, works real good...thanks for the inspiration Corayzon All were waiting for now is the LUA script, which will have a command such as !update which will execute the app from within the hub, save time looking through ptokax folders. lol | ||||||||||||
C0D3Z3R0 Pro Posts: 166 | can someone explain what socket programming is? | ||||||||||||
vickmaker Ametuar Posts: 127 | this is a wild guess but is it not programming using the winsock dll as the chosen method of communication :? //v | ||||||||||||
Corayzon Regular Posts: 67 | aw...lost allot of info i posted on the subject :cry: *plans to regroup when time is free to do another chat server and client for this example* | ||||||||||||
vickmaker Ametuar Posts: 127 |
i was thinking a good place to start would be about the level of "intrmediate" if you are gonna start again as i aint sure but i think most peeps are past the pure noob stage in vb, cud be wrong and i liked ure tut, just more lookin 4ward to getting advanced (ish), keep it up br0 great stuff, good luck //v | ||||||||||||
Corayzon Regular Posts: 67 | gotta start simple before u get advanced!, im just spewing because i wrote the entire server with a tut about 1 hour before the server was taken down =[ and it was long and awsome, not to mention i didnt save the source for the tut, so i cant even go back to start over again without rewriting 4 pages of information... but i promise when i have time after i finish my works next beta system, ill be here to make this intro into socket programming the best u have ever read anywhere online. sorry about the waiting to the guys that want this information | ||||||||||||
vickmaker Ametuar Posts: 127 |
ty my freind, glad you will redo it, its a bummer when u loose stuff completely and then need it again, done it with sources for projectd for exams the lot!! doh, dude i do sympathise and look 4ward to the best socket progging tut on the net, you couldnt find a better place for such a resource GL with all ure work peaceout //v | ||||||||||||
Exile n00b Posts: 30 | its a bitch that u lost ur posts man, they helped me aswell, seens as I only started programming to start my own DC client which I have not got round to doing yet as I am still working on therapy X wiv Shad. Taking longer than expected, not my end, his...lol, c ya around Truly, Exile | ||||||||||||
vickmaker Ametuar Posts: 127 |
ehhhhh, thats what they all say!! //V | ||||||||||||
Exile n00b Posts: 30 | my end is finished man, take a look, well...nearly, he still needs to send me the config file to code the GUI but the graphics r done, so is the updater and that part is 100% complete, jus waiting for this FUCKING CONFIG FILE *hoping shad will see this*. Hmmm, i cant get any pictures...webhost, wot a wanker | ||||||||||||
Corayzon Regular Posts: 67 | okies, got some time so here we go, ... -> Design'en da interface - Create a new project in visual basic 6 - Name the project 'ChatServerAndClient' - In the new project dialog select 'Standard EXE' and click OK - Rename the form 'Form1' to 'frmServer' - Add a new form to your project - And once again rename the form 'Form1' to 'frmClient - Press Ctrl+t to open the components dialog - Check Microsoft WinSock Control 6.0 - Click OK - Open frmServer's Object View mode - Add a WinSock control and name it Socket - Set Socket's Index property to 0 - Add and set the following properties for new TextBox controls [list:2dcb043e68]Name - Text - Multilinded ----------------------------------- txtPort - 12457 - False txtLog - server started - True txtSendData - none - True[/list:u:2dcb043e68] - Add and set the following properties for new CommandButton controls [list:2dcb043e68]Name - Caption -------------------------------------------------- cmdListen_Stop - Listen cmdDisconnectAll - Disconnect All[/list:u:2dcb043e68] Now we will do the same for frmClient with a few additions - Open frmClient's Object View mode - Add a WinSock control and name it Socket - Add and set the following properties for new TextBox controls [list:2dcb043e68]Name - Text - Multilinded ----------------------------------- txtHostAddress - 127.0.0.1 - False txtHostPort - 12457 - False txtLog - none - True txtSendData - none - True[/list:u:2dcb043e68] - Add and set the following properties for new CommandButton controls [list:2dcb043e68]Name - Caption -------------------------------------------------- cmdConnect_Disconnect - Connect[/list:u:2dcb043e68] And now we have our grafic user interface to implement our chat server and client *** read next post | ||||||||||||
Corayzon Regular Posts: 67 | -> Creating a server socket - Open the Standard EXE we started in the post called ChatServerAndClient - Open frmServer's Object View mode - Double click cmdListen_Stop - Add the following code
- Go back to frmServer's Object View mode - Double Click the socket control and 'Socket_Error' will be displayed - In the procedure list (top-right of code) select 'ConnectionRequest' - Add the following code to 'Socket_ConnectionRequest(...)'
- In the procedure list (top-right of code) select 'Close' - Add the following code to 'Socket_Close(...)'
- Go back to frmServer's Object View mode - Double Click cmdDisconnectAll - Add the following code to 'cmdDisconnectAll_Click()'
- Go back to frmServer's Object View mode - Double Click the socket control - In the procedure list (top-right of code) select 'DataArrival' - Add the following code to 'Socket_DataArrival(...)'
- Go back to frmServer's Object View mode - Double Click the txtSendData control - In the procedure list (top-right of code) select 'KeyPress' - Add the following code to txtSendData_KeyPress(...)
and now we have ourselfs a complex server socket that is atlease half smart *** there are issues im not going to point out right now that have been implemented for good socket index management *** ill write the client next time im free cyaz | ||||||||||||
Exile n00b Posts: 30 | nice post m8, well done. thats the bit i jus taught myself in VB, but would hav bin easier with this tutorial to help me along the way. Nice Nice Nice Truly, Exile | ||||||||||||
C0D3Z3R0 Pro Posts: 166 | nice tut, thanks for this, it was helpful |