Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Winsock API Vs. Winsock Control


Hi there, well i was wondering, what are your thoughts on the pros and cons to using the API over the control, or the Control over the API's, i understand the API require alot more code, so don't say use the control becuase its easier, but i am curious as to hear which would be more proficient for a program that is going to communicate with a remote FTP.

Now i am not sure if features are different in the control and APIs but a fwe things i was wondering are, is it possible to check the file size of a remote file on an FTP using winsock, i have been using the wininet API's but i am getting error 12003 from alot of the people using the program, why i have no idea, but its there, so i thought to try winsock to see if it solves it.

Using the winsock apis i was able to do a remote file size check, but i have searched the boards and can't find any code that would help me to see what the remote file size is.


Now for the real question.

I have read that alot of programs out there use code that checks a remote file to a local file byte by byte and if there is a difference between two bytes it updates ONLY that byte, my question, is there anyway to read a file remotly without downloading it? becuase i am not sure how they do this byte by byte thing, <shrug> anyway i was just curious really what you use, the WS control or the API. Thanks Much =)




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Winsock Syntax? (To Request A Website With The Winsock Control)
Ok, I don't know very much about Winsock and am just now starting to use it. I'm making an anonymity program that modifies referer and user agent data. I managed to find an example of how its done on planetsourcecode.com but there's a few things that aren't working.

Anyway, when this string is sent, it sends the headers and a request for index.html from the connected host (winsock1.connect domain.com 80).

GET index.html HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-comet, */*
Accept-Language: en
Accept-Encoding: gzip , deflate
Cache-Control: no-cache
Proxy-Connection: Keep-Alive
User-Agent: Whatever
Referer: www.whatever.com

But when I used the website http://ipid.shat.net/ as the domain to see if code mdified the headers or not, it directed me instead to just www.shat.net. How would a browser request information to ipid.shat.net?

Also, I noticed that by sending just that information, cookies don't work properly. What other tags do I have to add onto that for it to recieve my session information? Thanks a lot.

WINSOCK CONTROL Vs WINSOCK REFERENCE
Why with a Winsock refernce events don't work and with a Winsock control events work?
"public withevents MySock as winsock". With this declaration, I can't use events (like connectionrequest ecc.).
With a WinSock control I can use events. WHY????

Winsock API Webserver (not Winsock Control)
Hi,
I'm trying to do a winsock webserver, that can handle lots of connections at once.
each new connection request creates a new instance of the winsock control
ie load winsock(1).....etc
it needs to be able to handle 200 users but it looses connection requests every so often and so some people cant connect I think this is because the winsock control cant handle so many connections at once. Would coding using the WIN API be better (quicker)???
Thanks
Paul

Flushing In Winsock Control And Winsock API
I used to work in Java Sockets previously and there I have been using flush method of the associated stream with Socket class to make sure that the data I sent using Sockets is successfully sent; simple to flush the Socket.

But, here in Vb I can find any function or method fulfilling the same purpose. Can anyone give me some idea about how to do it with Winsock Control or Winsock API?

Normally winsock works quiet well but in my previous project I faced a related problem about transmitting data. Therefore, while using it for the second time, I am a concious about it and working on the solution to the 'data delay' problem before working on the actual system.

thanx

Winsock API Vs. Winsock Control
What advantage is there to useing the winsock api instead of the winsock control, is there one? or does it just make it exponentially more complicated

Winsock Without Winsock Control
Is there a way that I can communicate with another computer on the network (already running my server app) without creating a form with a winsock control? I am trying to write a command line only app that needs to transmit a string to the server. (I the only time I have ever done this was when I used the Winsock control.) Maybe an API call or something like that?

Also, how can I write output back to the DOS window. For example you can type DIR /? at the command line and you get a listing of the available options as well as a some help with using the DIR command. I would like my program to have this ability.

Any help would be greatly appriciated!

Thanks

Is The Way 2 Send Data &amp; Get Data Like Winsock Do....... W/o Using Winsock Control ?
Is the way 2 send data & get data like winsock do....... w/o using winsock control ?


thnx in advance!!

Winsock State 8 - Peer Closes The Connection Leaving Winsock High And Dry
I am debugging some web/proxy-serving code. I am stumped.

I get Winsock state 8 - Peer is closing the connection
Then Winsock error message wrong protocol or connection state.

It seems to me that Winsock closes before it can finish sending all of its data.

How can I keep Winsock in state 7 - Connected?


Thanks...

Winsock Error (System Lockup Upon Winsock Execution)
Has anyone encountered an issue when running the winsock command and either a .listen or .connect locks up your VB Studio? This is occurring on my system and I'm not sure if its a problem with my current DLL or if I'm just not doing something correctly.

Please help.

Chris, Baltimore.

Winsock - Send PictureBox Contents Thrue Winsock?
Hey all, is it possible to send the contents of a PictureBox thrue a Winsock?

I know i can save the contents first to file and then send as file, but wondering this is possible, the purpose is in my chat project i have a webcam capture feature wich works fine, but i can't figure out how i can send this stream, did some searches but not found any results about it.

=============================================
aka Red2048.

Very Frustrating Winsock Bug.. Winsock Stops Responding After A While.
I have about 100 winsocks in an array handling a bunch of tasks.

The program seems to work fine for a while, but then for no reason, winsock stops responding. I can receive and send thosuands of packets before this happens but when the bug occurs it is extremely frustrating.

Winsock seems to die completely. DataArrival never fires, I cant make new connections (Always stuck on 'Connecting..'), its a mess. Closing the program and reopening it does not solve the problem - I have to close VB6 entirely and reopen it for the application to work again.

Has anyone dealt with something like this in the past?

I have no idea whats wrong

Winsock Error &lt;winsock.getdata Strdata
Hi

I am using winsock control named tcpclient in my application.
When i call the statement as

tcpclient.getdata strdata

It raises an error showing as

Runtime Error : "10054"
The connection is reset by remote side

I don know why this error is coming pls help me if uve any idea


Thanx

Will Winsock Get Timedout? Can Do Login On Winsock.connect?
Hi all,
Just wondering, let say I connect to a server using Winsock and leave the connection open... does Winsock timeout or close that connection? If yes, how long winsock give before it timeout/close the connection?

Is it possible to do a login on winsock.connect; ie: winsock.connect userid, pwd? I'm thinking if possible everytime i connect, i pass the userid and pwd to the server for validation... if all correct than accept the connection else reject... is this possible?

Thank You
Regards

Winsock Control
hi, could anyone help me on creating program that could control,view users,and could know the time they have been logged on the internet on LAN?

Can Someone Please Help Me? {Winsock Control}
I have VB 6.0 learning edition and dont have the winsock control. If I purchase visualbasic.net will it have the winsock control?

It is listed as Microsoft Internet Control in the components list

Help With Winsock Control In Vb 6.0
so i am trying to make an application that more then one person will be connecting to using the winsock control, i was wondering if i needed more then more winsock control, or is there a way to do it with one??

Winsock Control
Hi.
Well, I'm making an application using the winsock control. It sends a HTTP request and asks for the latest update and downloads news.

When I start it, it works.
BUT when I start it on another computer (ex. my laptop) I receive this error message:
Component 'MSWINSCK.OCX' or one of its dependencies not correctly registered: a file is missing or invalid

Its SO frustrating. I can't make 1 program for all OSes and Service Packs.
Anyone got any tips or suggestions?

In advance, Thanks.

Winsock ... Which One To Use? API Or Control?
Im writting an app that will use use both TCP and UDP. This app will communicate with other users via UDP and with a HTTP server via TCP.

I will need to use at least 2 sockets. One for the UDP and one for the TCP.

Questions:

1. Am i doing the right thing by using the Winsock API ONLY , in order to avoid having to distribute the ocx .... or do all Windows pcs allready have the winsock ocx installed, and i should therefore use it, but not include it in my Setup.



2. Are there any benefits to using the API instead of the control? (besides that theres no need to include an ocx in setup)

Winsock Control
ive never used winsock controls before and ive been looking for a good tutorial that tells me what each property and member does but i cant find one. can anyone point me in the right direction?

Winsock Control Help
i wanna create a chat prog, for a friend's website......but i don't know jack about Winsock Control.....i wanted to know if u guys have source to a prog that uses winsock or a website that teaches ya how to use winsock....

THANKS

Where Is The Winsock Control?
This is a really silly question, but the answer is nowhere to be found!

I cannot find the Mircrosoft Winsock Control! I'm pretty sure I'm looking in the right place; I'm clicking Project --> Components and then looking under Controls. Most tutorials say that the Microsoft Winsock Library is pre-installed, so there is no need to download it, but perhaps my computer doesn't have it? I have Microsoft Visual Basic 6.0, and am using a Windows XP.

More likely there is just something obvious that I'm missing...

Thanks in advance!

About Winsock Control
Hi basically i have created a winsock control (chat client) that connects to a server i specifie. Now i want this client to automatically respond. To words said to the app.
All the data sent to the client is displayed in a textbox.

So when it receives a message it looks like this if the user that sent the data is JD (to the client)..... it looks like this.

JD tells you: messagehere

so i want the client to notice the username part and do this
tell usernamehere Hello i am sorry i am only a bot and cannot respond.

I know it is something to do with a string but i am not sure how to do it.
in order to send a message to another user in this server you type tell usernamehere messagehere

thanx in advance!!!!!

Winsock Control
hi guys.. I need help regarding vb6 enterprise edition... I dont know whats causing the problem..

.. Everytime I tried to load mswinsck.ocx as a component I always recieve a message... "mswinsck.ocx cannot be loaded"... all other .ocx loaded fine except for this .ocx.....

.. I downloaded the vb6sp6 and installed it already.. I even manually registered the mswinsck.ocx using regsvr32..

... I tried to open a project with mswinsck.ocx loaded as a component... but I recieve an error on a log file when opening it on my computer..

Line 1421: Class MSWinsockLib.Winsock of control Socket was not a loaded control class.

... I dunno.. it seems Im the only one who ever encountered this error..
.. seems like everybody can load microsoft winsock control as component without a problem..

Winsock Control ??
Hi, I have a form that gets my local ip address and it works fine, but I need a command button or something ?? that resets the text field which shows my IP address and the winsock.localip . Can someone help me with this? I am a beginner at this .

Thanks in advance.

GBS

Winsock Control
Hi, im looking for the winsock control in the components tab and i cant find it. Do i need to download it or is it hidden under a weird name.
Thanks for any help.

Winsock Control?
I'm trying to put a winsock control on my form but when i go to components and select it and click OK I get this message:
"Name conflicts with existing module, project, or Object library"
What??

Winsock Control
I have an application that consists of three seperate exe's Admin, client, and server. Admin sends data to the server to process. When done the server sends data to a various number of clients within a domain then the client does any one of a number of tasks depending on the data received.

ADMIN---&gt;SEVER----&gt;CLIENT

The admin has various input controls, and a winsock control (win1). The properties for the control are:

win1.remotehost="process" (name of server)
win1.remoteport=1003
win1.protocol="UDP"
win1.bind 1005

In the server exe there are 2 winsock controls (win1 and win2) Win1's settings are:

win1.protocol="UDP"
win1.bind 1003

win1 listens only.

Win2 sends data to the clients after the server has finished processing the information and has determined what clients to send the data to.

The problem is the message is not getting to the server. I have verified the sever name, and even tried using ip address instead. I also tried installing the server.exe on another server. The interesteng thing is when I run the server app on my computer and not the server it functions perfectly.

Does anyone have any suggestions?

Thank you

How To Add A Winsock Control
How do i add a winsock control to my form? I cant find it anywere! :S

Thanks Wir33r

Winsock API Or Control
Will somebody please enlighten me on what the difference is between using the Winsock control and using the API for Winsock? If I use the API, do I need to carry around the control for older computers? I do not think I would. I wouldn't mind using the API then for it. Please don't just say, "The Winsock control does everything for you buddy!" because I know that much. I mean, I would like a simple explanation. That would be nice.

I also wonder, if the Winsock control is sooo good, then why does VBIP.com use so many Winsock API examples?

Winsock Control
I am using a winsock control in one of my projects to send simple messages over, basically like a chat program. this is working on my home network.
is there any way to get this to work across the internet? eg send a message across countries using it? if so, how would i know what ip to put in for the .remotehost to connect to?

Winsock Control
I have three pc's connected via a switcher. I want to send data to two of these from one pc. Do I use two winsock controls or one winsock and modify the remote address? Please keep in mind we are dealing with a novice. Also is there a link to understanding winsock in simple terms?

Winsock Control (TCP/IP)
Hi,

I want to double confirm that if I have 1 winsock control in my form,

then I set both LocalPort & RemotePort to 1110 & 1111.

Is it possible that I can receive & send data at the same time?

Thanks in advance

WINSOCK Control
I have an application where I may need to "read" information sent to my machine vie TCP/IP and I have read up on other internet sites about something called a WINSOCK control. I think I might like to include these in my project, but don't know how. Are these "included" by a reference under Tools in my IDE? Help!!!

How To Add Winsock Control In Vb6
How to add winsock control in vb6?
How to draw winsock control in my form?

Winsock Control
Quote:




---------------------------
Microsoft Visual Basic
---------------------------
License information for this component not found. You do not have an appropriate license to use this functionality in the design environment.
---------------------------
OK Help
---------------------------






i never had this before , can i fix this?

WinSock Control
Hello,
Can we use Winsock control for LAN Database programming ?
How ?
Please help me with a short program or example

Farooq

Winsock Control
I've never used this control before and I cannot get the sample chat program from msdn working. I place the server app on one machine and check the state property of the winsock control. It comes up 2, for "listening". So far so good. When I try to connect to the server with the client, the state hangs indefinately at state 6, "waiting for connection".

Can the client and the server be on the same computer?
If the server has multiple IP addresses, how do I know which one to use. My method of setting the remote machine name property of the client app was by typing ipconfig into the command prompt of the server computer. I tried all three that came up. Are there any requirements for the server computer other than that it have an active connection to the internet. Can it simply take a very long time to connect?

Please help, this is my first post!

Winsock Control
Okay, I've come up with this problem before.. and it is bugging me again.

Using an array of sockets with the microsoft winsock control, When trying to send data to all of them.. It only sends to one, And the rest just sit there with the data.. But not sending it.

The strange thing is if I open a message box, And close it.. The sockets send the data after.

Is there a good way to somehow refresh the sockets to make them send the data thats there to be sent? Or am I going to have to do that damn "Send complete" thing.. Where it sends to one until its done sending...Then send to next until its done.. then next.. And so on.

I suppose the send complete one would work, But I want to avoid that... A nice sockets().Refresh thing would be nicer..

Please throw me some ideas.

How To Use Winsock Control?
Just asking on how to use winsock control?

I try to look for the components in VB but it doesn't exist. Is it downloadable?

Where's Winsock Control?
I can't find how to load the Microsoft Winsock Control. I don't see it in my components?!

Winsock Control
I want to create a simple application which connect two pc one is client and 2nd is server...

the client can see all the folders/files of the server and can copy it from server to client...

also the application run automaticy when the server start...

I think it is possible thru winsock control...
what do u say about it???

Winsock Control
Probably a dumb question but i need a winsock control, i have a simple one line code for retrieving the IP i just need a winsock control to do it. Also can someone post the code to the current application into the system registry so it will run everytime on start-up. Thanks

MS Winsock Control
Hello all,
After reading the great artical on using the winsock control I thought I'd give it a go but when I went to add the control to my project I got the following error message "License Information for this control is not found..." I have tried re-registering it with the RegSvr32 program but it does nothing.

Any help would be greatfully received.

Thanks,
Desire

Winsock Control
i need to send data to a local I/O port of my computer, pls tell me which control to use. i tried winsock , but can't get thru the settings. can anyone pls explain how to go abt it step b step.

any help/clue will be highly appreciated!
thanks

shruti

Winsock Control
Hi All,

Can somebody point me in the right direction for using the winsock control.

I have an RS232 Device connected to a converter board tcp/ip to RS232. My converter board is connected to the network.

I need to listen for information from the device and act on it in my VB program (version 6). How would I do that.

I have placed :

Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
If Winsock1.State <> sckClosed Then
Winsock1.Close
End If
Winsock1.Accept requestID
End Sub

Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Winsock1.GetData StrMessage
MsgBox StrMessage
End Sub

and in the form load event

winsock1.listen

The device is sending no problem because I receive the correct information when connected straight to the Com port and using the mscomm control. from the above I do not get a message box appearing.

Winsock Control
Hi
1) I am doing Winsock (Client/Server) Project in VB 6. My server program updates the status of all client machines, whether it is ready, hanged or shutdown (After the client is connected to the server). I made the connections, it works fine. How to solve the status of the connections?

2) I am launching a Counter Strike game from VB Application by using following command

sub command1_click()
shell("C:SIERRAHALF-LIFEHL.EXE -CONSOLE -GAME CSTRIKE",VBNORMALFOCUS)
End Sub

This game is launching after I clicked this button. But we can't connect to other's servers. If I play this game without launching from VB, it works fine. How can i solve this?
Thanks in advance.
Knowledge Seeker.


Thanks in advance.
MAK

Winsock Control
HI,

I have Server (S) and Client(C) application that use winsock controls as below:

C1-S-C2

I would like to pass a data package from C1 to C2. Could you please tell me how to do this? I can pass data from C1 to S but from S to C2 I have a error message.

Thanks in advances.

Trung Luu

Winsock Control
can someone tell me where I can retrieve a mswinsck.ocx control

Winsock Control In XP
I have developed a Visual Basic application (.exe). Its main purpose is to connect to different sites. I have used a .dll in this application which in turn uses Winsock control to make connection to a remote site.
This is developed in Windows NT. This application is working fine in NT and Windows 98. The same application is not working in Windows XP systems.

When I install this application in XP system and run it. I am getting the
following error.
Error Number: 429
Active X component cannt create object

When the application is creating the instance of .dll I am getting the error.

Thanks in advance

Vinod

Copyright © 2005-08 www.BigResource.com, All rights reserved