Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
OstroSoft Winsock Component
 OstroSoft Forums : OstroSoft Winsock Component
Subject Topic: General Help on Use Sockets Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
dosucha1
Newbie
Newbie


Joined: 26 December 2007
Online Status: Offline
Posts: 1
Posted: 26 December 2007 at 1:03pm | IP Logged Quote dosucha1

 I am  working on an application now where I need to have some computers communicate using sockets.  The main computer is running a PLC HMI software that has embedded within it VBA.  This machine will need to act as a server to another machine and as a client to yet a third machine.  When I reviewed Microsoft's Winsock object, it looks like it needs to function within a UserForm, which I would rather not use.  I have some general questions about anyone's use of the Ostrosoft object (or even comments from Ostrosoft) because this is my first time trying to set up socket communications and I am a intermediate programmer:

"When I am listening, does my code need to loop until something happens, and if so, what?"  "Once connected, will a connection ever self-terminate or must I call a method to disconnect?" "What is the normal format for data being transferred?"  "Is it best to connect, send data and then disconnect, or just remain connected continuing to look for new data to arrive?"   "If I don't want to use a UserForm, will this control work within a regular module?"  "Has anyone ever created a 'wrapper' class module for the control, and if so, could you share the code?"

 

 

Back to Top View dosucha1's Profile Search for other posts by dosucha1
 
igor
Admin Group
Admin Group


Joined: 20 July 2005
Location: United States
Online Status: Offline
Posts: 252
Posted: 30 December 2007 at 9:14pm | IP Logged Quote igor

You can use Winsock Component in a regular module or in a class module without any wrapper.

Data format depends on what your application expects (on a protocol you'll be using) - Winsock Component support both binary and text data.

It's always a good idea to explicitely disconnect from the server (call .CloseWinsock method).

Winsock Component is event-based. When data arrives it fires OnDataArrival() event. You don't need any loops

Back to Top View igor's Profile Search for other posts by igor Visit igor's Homepage
 
Emin
Newbie
Newbie


Joined: 29 January 2009
Location: Croatia
Online Status: Offline
Posts: 1
Posted: 29 January 2009 at 4:25pm | IP Logged Quote Emin

I'm trying to build a console application using VB6 and OstroSoft Winsock dll.

Project having no forms, I cannot use the ocx, so no events and such.

I'm I going about it the right way looping for messages with GetData method, or is there a better way?
Back to Top View Emin's Profile Search for other posts by Emin
 
igor
Admin Group
Admin Group


Joined: 20 July 2005
Location: United States
Online Status: Offline
Posts: 252
Posted: 30 January 2009 at 10:31am | IP Logged Quote igor

I suggest using blocking TCP object for it.

Go to http://www.ostrosoft.com/oswinsck.asp and scroll to the bottom of the page for more info
Back to Top View igor's Profile Search for other posts by igor Visit igor's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.92
Copyright ©2001-2004 Web Wiz Guide