Winsock 
Author Message
 Winsock

Greetings,
 I've been trying to work with the Winsock control and encounter an error
with the "ConnectionRequest" event and the "Winsock1.accept" method; an
error screen pops up complaining that the operation "Accept" is invalid at
the current state. =\  I obviously can't get Winsock to accept the
connection without this method, can anyone suggest a solution?
 Thanx,
   -Brian


Thu, 27 Feb 2003 23:00:21 GMT  
 Winsock
You have to call Winsock1.Close before calling Winsock1.Accept.
Quote:

>Greetings,
> I've been trying to work with the Winsock control and encounter an error
>with the "ConnectionRequest" event and the "Winsock1.accept" method; an
>error screen pops up complaining that the operation "Accept" is invalid at
>the current state. =\  I obviously can't get Winsock to accept the
>connection without this method, can anyone suggest a solution?
> Thanx,
>   -Brian



Sat, 01 Mar 2003 10:17:34 GMT  
 Winsock
Hm... so first i *close* the socket, then i accept the connction? =)  It
doesn't make sense, but i trust you and i'll try it out. ; )
 Thanks,
     -brian


Quote:
> You have to call Winsock1.Close before calling Winsock1.Accept.


> >Greetings,
> > I've been trying to work with the Winsock control and encounter an error
> >with the "ConnectionRequest" event and the "Winsock1.accept" method; an
> >error screen pops up complaining that the operation "Accept" is invalid
at
> >the current state. =\  I obviously can't get Winsock to accept the
> >connection without this method, can anyone suggest a solution?
> > Thanx,
> >   -Brian



Sat, 01 Mar 2003 23:33:10 GMT  
 Winsock
Yep, thats the way Winsock Control works. Do it to believe it.

Quote:

>Hm... so first i *close* the socket, then i accept the connction? =)  It
>doesn't make sense, but i trust you and i'll try it out. ; )
> Thanks,
>     -brian


>> You have to call Winsock1.Close before calling Winsock1.Accept.


>> >Greetings,
>> > I've been trying to work with the Winsock control and encounter an
error
>> >with the "ConnectionRequest" event and the "Winsock1.accept" method; an
>> >error screen pops up complaining that the operation "Accept" is invalid
>at
>> >the current state. =\  I obviously can't get Winsock to accept the
>> >connection without this method, can anyone suggest a solution?
>> > Thanx,
>> >   -Brian



Sun, 02 Mar 2003 11:43:30 GMT  
 Winsock
2min... You must be using a *different* version of Visual Basic 5.0 than i
am, or atleast a different Winsck.ocx version. Mine took a max of a few
seconds. =\
 *keep it real*
   -Brian


Quote:
> Under VB5, closing a used socket took a while (2 min. or so)
> until the socket control became reusable. Check the socket's
> state (sckClosed) before re-using it.

> Alex



> > Yep, thats the way Winsock Control works. Do it to believe it.


> > >Hm... so first i *close* the socket, then i accept the connction? =)
It
> > >doesn't make sense, but i trust you and i'll try it out. ; )
> > > Thanks,
> > >     -brian


> > >> You have to call Winsock1.Close before calling Winsock1.Accept.


> > >> >Greetings,
> > >> > I've been trying to work with the Winsock control and encounter an
> > error
> > >> >with the "ConnectionRequest" event and the "Winsock1.accept" method;
> an
> > >> >error screen pops up complaining that the operation "Accept" is
> invalid
> > >at
> > >> >the current state. =\  I obviously can't get Winsock to accept the
> > >> >connection without this method, can anyone suggest a solution?
> > >> > Thanx,
> > >> >   -Brian



Sun, 02 Mar 2003 03:00:00 GMT  
 Winsock

Under VB5, closing a used socket took a while (2 min. or so)
until the socket control became reusable. Check the socket's
state (sckClosed) before re-using it.

Alex


Quote:
> Yep, thats the way Winsock Control works. Do it to believe it.


> >Hm... so first i *close* the socket, then i accept the connction? =)  It
> >doesn't make sense, but i trust you and i'll try it out. ; )
> > Thanks,
> >     -brian


> >> You have to call Winsock1.Close before calling Winsock1.Accept.


> >> >Greetings,
> >> > I've been trying to work with the Winsock control and encounter an
> error
> >> >with the "ConnectionRequest" event and the "Winsock1.accept" method;
an
> >> >error screen pops up complaining that the operation "Accept" is
invalid
> >at
> >> >the current state. =\  I obviously can't get Winsock to accept the
> >> >connection without this method, can anyone suggest a solution?
> >> > Thanx,
> >> >   -Brian



Sun, 02 Mar 2003 18:29:00 GMT  
 Winsock
Maybe I was using another OS (Win98/Win95)?
Anyway, it takes a while...

Alex


Quote:
> 2min... You must be using a *different* version of Visual Basic 5.0 than i
> am, or atleast a different Winsck.ocx version. Mine took a max of a few
> seconds. =\
>  *keep it real*
>    -Brian


> > Under VB5, closing a used socket took a while (2 min. or so)
> > until the socket control became reusable. Check the socket's
> > state (sckClosed) before re-using it.

> > Alex



> > > Yep, thats the way Winsock Control works. Do it to believe it.


> > > >Hm... so first i *close* the socket, then i accept the connction? =)
> It
> > > >doesn't make sense, but i trust you and i'll try it out. ; )
> > > > Thanks,
> > > >     -brian


> > > >> You have to call Winsock1.Close before calling Winsock1.Accept.


> > > >> >Greetings,
> > > >> > I've been trying to work with the Winsock control and encounter
an
> > > error
> > > >> >with the "ConnectionRequest" event and the "Winsock1.accept"
method;
> > an
> > > >> >error screen pops up complaining that the operation "Accept" is
> > invalid
> > > >at
> > > >> >the current state. =\  I obviously can't get Winsock to accept the
> > > >> >connection without this method, can anyone suggest a solution?
> > > >> > Thanx,
> > > >> >   -Brian



Tue, 04 Mar 2003 03:00:00 GMT  
 Winsock
Set the localport to 0 first, theres something about non-zero ports
taking 4 mins to time out (some RFC I forget).  Then close it.
out of interest, try looking at the state while you do things, I've
found it well worth putting in;
do while winsock.state <> sckConnected
        doevents
loop

just to make sure it is where it should be.

Hope this helps and is applicable to your problem

Robo



Quote:
>Maybe I was using another OS (Win98/Win95)?
>Anyway, it takes a while...

>Alex



>> 2min... You must be using a *different* version of Visual Basic 5.0 than i
>> am, or atleast a different Winsck.ocx version. Mine took a max of a few
>> seconds. =\
>>  *keep it real*
>>    -Brian


>> > Under VB5, closing a used socket took a while (2 min. or so)
>> > until the socket control became reusable. Check the socket's
>> > state (sckClosed) before re-using it.

>> > Alex



>> > > Yep, thats the way Winsock Control works. Do it to believe it.


>> > > >Hm... so first i *close* the socket, then i accept the connction? =)
>> It
>> > > >doesn't make sense, but i trust you and i'll try it out. ; )
>> > > > Thanks,
>> > > >     -brian


>> > > >> You have to call Winsock1.Close before calling Winsock1.Accept.


>> > > >> >Greetings,
>> > > >> > I've been trying to work with the Winsock control and encounter
>an
>> > > error
>> > > >> >with the "ConnectionRequest" event and the "Winsock1.accept"
>method;
>> > an
>> > > >> >error screen pops up complaining that the operation "Accept" is
>> > invalid
>> > > >at
>> > > >> >the current state. =\  I obviously can't get Winsock to accept the
>> > > >> >connection without this method, can anyone suggest a solution?
>> > > >> > Thanx,
>> > > >> >   -Brian



Tue, 04 Mar 2003 03:00:00 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. winsock problem sending large strings (winsock.senddata)

2. Multiple Winsock-Connections to a server AND Winsock-Connection to a server minimized in systray

3. Winsock OCX vs Winsock API?

4. Winsock documentation - winsock.txt (0/1)

5. Winsock Activex DLL and winsock events

6. Winsock OCX vs. Winsock API

7. How to use Winsock without placing the Winsock OCX on a form

8. VB6 Winsock Control vs. Winsock API

9. Winsock Control Error 2 winsock.listen

10. WinSock control CPU hog and gimme WinSock API! :)

11. Winsock vb Control vs Winsock 32 API??

12. use the winsock Control or winsock API

 

 
Powered by phpBB® Forum Software