Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Communications > winsock basics

Thread Tools Display Modes
Old 04-18-2012, 02:31 PM
tilky tilky is offline
Join Date: Nov 2011
Posts: 23
Default winsock basics

can someone post a code of how i can send data to specific IP address using winsock? I tried this, but i only partly understood it and had absolutely no idea as to what the port is supposed to be set to.
Reply With Quote
Old 05-26-2012, 09:23 PM
meggy_e meggy_e is offline
Join Date: Dec 2002
Location: Indonesia
Posts: 186

To make it simple, imagine a warehouses complex that has their each address (similar to IP address), each warehouse has sections for different things (this is port number), if there's no section on the warehouse (no port #) then packet will be lost, thus RTO, If the port is active/open, but no one (no application/winsock) is waiting to receive any packet sent (winsock Listen method) then the packet is lost.

So firstly, you need to bind winsock to specific IP and port. IP address is simply the target machine, port is the "place" where your packet should be received.

1st Machine
'make sure there's an application at target machine that Listen on the same port
winsock.Bind LocalPort, LocalIP
Ugh, i forgot the rest... here i attach a code i develop when i was still a juvenile,young and reckless (not to mention having no live, just being a common nerd)

Btw,use it freely... i don't care much about it anymore. it's a project where i was supposed to make things work in a week <.< and as time goes by, new functions added, and suddenly bugs gathered all around. btw, i'm indonesian... so maybe some variable/comment is not in common english, Use MSDN, everything is documented there.
Attached Files
File Type: zip Billing.zip (705.6 KB, 23 views)
Reply With Quote

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..