Jump to content



Photo

TCP UDF, Event driven!


  • Please log in to reply
316 replies to this topic

#21 Kip

Kip

    When done learning: die

  • Active Members
  • PipPipPipPipPipPip
  • 1,685 posts

Posted 28 June 2008 - 02:37 PM

Thanks Kip thumbsup.gif

You're welcome.

(Where is our Visual AutoIt? crying.gif )

Still in my fantasy :P :)
There's a big chance this post has been edited.Posted Image





#22 DexterMorgan

DexterMorgan

    My Member Title

  • Active Members
  • PipPipPipPipPipPip
  • 890 posts

Posted 28 June 2008 - 02:48 PM

You're welcome.

Still in my fantasy :P :)



You are the one making Visual Autoit ?? Cool
code

#23 Kip

Kip

    When done learning: die

  • Active Members
  • PipPipPipPipPipPip
  • 1,685 posts

Posted 28 June 2008 - 02:51 PM

You are the one making Visual Autoit ?? Cool

mweh... yeah.

Edited by Kip, 28 June 2008 - 02:52 PM.

There's a big chance this post has been edited.Posted Image

#24 DexterMorgan

DexterMorgan

    My Member Title

  • Active Members
  • PipPipPipPipPipPip
  • 890 posts

Posted 28 June 2008 - 04:15 PM

mweh... yeah.

That is so cool :) Good Luck... Seems really hard... probably is.... lol
code

#25 WeMartiansAreFriendly

WeMartiansAreFriendly

    Where's the kaboom?

  • Active Members
  • PipPipPipPipPipPip
  • 1,245 posts

Posted 28 June 2008 - 11:06 PM

Very nice kip, simplifies things quite a bit.
Posted ImageDon't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet()

#26 GtaSpider

GtaSpider

    Polymath

  • Active Members
  • PipPipPipPip
  • 209 posts

Posted 29 June 2008 - 10:07 AM

Hi

Fantastic :P
Why not autoit have smth like TCPCreateCallback(Socket, mode, Function) (e.g. TCPCreateCallback($hSocket,$TCP_RECEIVE,"_TCPRecvEvent") or TCPCreateCallback($hSocket,$TCP_SOCKETCLOSE,"_GoodBye"))?
Maybe this would be a feature request :P

THanks for your amazing script Kip :)

Your Spider

www.AutoIt.de - Moderator of The German AutoIt FroumPosted Image


#27 H5O20H

H5O20H

    Seeker

  • Active Members
  • 34 posts

Posted 29 June 2008 - 10:16 AM

When will this UDF be included in AutoIt?
Valik, The Legendary programmer!Will be using that signature for 2 months due to my loss on a bet ):

#28 GtaSpider

GtaSpider

    Polymath

  • Active Members
  • PipPipPipPip
  • 209 posts

Posted 29 June 2008 - 10:38 AM

It would be better if this UDF will going to the core-functions in AutoIt. :)

www.AutoIt.de - Moderator of The German AutoIt FroumPosted Image


#29 Kip

Kip

    When done learning: die

  • Active Members
  • PipPipPipPipPipPip
  • 1,685 posts

Posted 29 June 2008 - 07:06 PM

It would be better if this UDF will going to the core-functions in AutoIt. :P

:)
There's a big chance this post has been edited.Posted Image

#30 Kip

Kip

    When done learning: die

  • Active Members
  • PipPipPipPipPipPip
  • 1,685 posts

Posted 29 June 2008 - 07:49 PM

I'm already busy a much better version of this udf. It supports OnConnectionLost (That's new for autoit :) ), OnSendError, OnReceiveError, and more.
And the new one is really event driven, not like now, that every 50ms is checked if somthing is recieved.

So it also supports this:

Why not autoit have smth like TCPCreateCallback(Socket, mode, Function) (e.g. TCPCreateCallback($hSocket,$TCP_RECEIVE,"_TCPRecvEvent") or TCPCreateCallback($hSocket,$TCP_SOCKETCLOSE,"_GoodBye"))?


Edited by Kip, 29 June 2008 - 07:56 PM.

There's a big chance this post has been edited.Posted Image

#31 Alek

Alek

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 330 posts

Posted 29 June 2008 - 11:42 PM

I love it :) I cant believe no one has ever done this before (or have I missed it?!)

I hope you don't mind me changing a few things on the event bit.

Attached File  TCP.au3   7.99K   1005 downloadsAttached File  Server.au3   687bytes   956 downloadsAttached File  Client.au3   903bytes   991 downloads

Edited by Alek, 30 June 2008 - 12:00 AM.

Never fear, I is here.

#32 Xand3r

Xand3r

    Aka TheMadman

  • Active Members
  • PipPipPipPipPipPip
  • 454 posts

Posted 30 June 2008 - 06:07 AM

I love it :) I cant believe no one has ever done this before (or have I missed it?!)

I hope you don't mind me changing a few things on the event bit.

Attached File  TCP.au3   7.99K   1005 downloadsAttached File  Server.au3   687bytes   956 downloadsAttached File  Client.au3   903bytes   991 downloads

Nice job Alek :P
Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

#33 goldenix

goldenix

    Universalist

  • Active Members
  • PipPipPipPipPipPip
  • 735 posts

Posted 30 June 2008 - 09:47 AM

Here is something that i think is a must for any multi-client tcp server :P
edit: A small chat made in 5 minutes :P with this udf:X
P.S.: you need the broadcast udf :)

This is what i get when i try to run your client code.
ERROR: _TcpEvent_Client_Create(): undefined function. ERROR: _TcpEvent_Client_Send(): undefined function.

Edited by goldenix, 30 June 2008 - 09:55 AM.


#34 Xand3r

Xand3r

    Aka TheMadman

  • Active Members
  • PipPipPipPipPipPip
  • 454 posts

Posted 01 July 2008 - 09:07 PM

This is what i get when i try to run your client code.

ERROR: _TcpEvent_Client_Create(): undefined function. ERROR: _TcpEvent_Client_Send(): undefined function.

it used an older version than the one made by alek :)
Only two things are infinite, the universe and human stupidity, and i'm not sure about the former -Alber EinsteinPractice makes perfect! but nobody's perfect so why practice at all?http://forum.ambrozie.ro

#35 inet

inet

    Seeker

  • Active Members
  • 20 posts

Posted 01 July 2008 - 09:36 PM

I'm already busy a much better version of this udf. It supports OnConnectionLost (That's new for autoit :) ), OnSendError, OnReceiveError, and more.
And the new one is really event driven, not like now, that every 50ms is checked if somthing is recieved.

So it also supports this:


Looking forward to the new UDF then :P When you think you will be finishing it??

#36 ptrex

ptrex

    Universalist

  • MVPs
  • 2,399 posts

Posted 02 July 2008 - 12:08 PM

@Kip


Just a tip.

The ultimate UDF would included Events but as well AsyncSocket

Regards,

ptrex

#37 Kip

Kip

    When done learning: die

  • Active Members
  • PipPipPipPipPipPip
  • 1,685 posts

Posted 02 July 2008 - 01:00 PM

I'm just finished with that :) You're ruining the surprise :P :P
There's a big chance this post has been edited.Posted Image

#38 Kip

Kip

    When done learning: die

  • Active Members
  • PipPipPipPipPipPip
  • 1,685 posts

Posted 02 July 2008 - 01:36 PM

Ok, new UDF uploaded. It's not much simpler. I hope you can still understand the new version.

This is really event driven. Using the UDF created by Zatorg.

New function names, so you'll have to rewrite some stuff.

Edited by Kip, 02 July 2008 - 01:51 PM.

There's a big chance this post has been edited.Posted Image

#39 inet

inet

    Seeker

  • Active Members
  • 20 posts

Posted 02 July 2008 - 01:51 PM

Very nice !!! :)

I was looking forward to the _OnConnectionLost Function or can i achieve something like that with the funcs allready implemented?

#40 Kip

Kip

    When done learning: die

  • Active Members
  • PipPipPipPipPipPip
  • 1,685 posts

Posted 02 July 2008 - 01:52 PM

I was looking forward to the _OnConnectionLost Function or can i achieve something like that with the funcs allready implemented?

No :)
There's a big chance this post has been edited.Posted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users