This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

socket example

Old posts that have not been replied to for several years.
Locked
i
intrw

socket example

Post by intrw »

Hi Ho.
I've tryed to search but I dont find any good example to how I use sockets.
I want it works when somebody send Song and Name data in a form to "www.myserver.com:4000/?choose=songrequest" it will come song and name from the form to my channel.
O
Ofloo
Owner
Posts: 953
Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:

Post by Ofloo »

hope this is what u mean cause don't understand exactly what u are saying..

Code: Select all

catch {socket host port} sock
that string will set sock as variable and if the variable matches sock?? well then u connected other wize u didn't

Code: Select all

if {[string match -nocase sock?? $sock]} { .. } else { .. }
and so on ..

note: you can write ur data to $sock once u connected use

Code: Select all

fconfigure $sock -blocking 0 -buffering line
to make it non blocking well at least thats what i do ;) if its the right way .. don't know but it works or use flush..
XplaiN but think of me as stupid
Locked