imk0tter

Socket Class Example

Jan 22nd, 2020
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
mIRC 0.53 KB | None | 0 0
  1. alias SocketTest {
  2.   var %socket $Socket(google.com,80,GoogleSock)
  3.   $socket(%socket,SockeOpen).sockopen
  4.   $socket(%socket,SockRead).sockread
  5.   $socket(%socket).connect
  6. }
  7. alias SockeOpen {
  8.   echo -a You have successfully connected to $sock($sockname).ip $+ : $+ $sock($sockname).port - $string($socket($1).tag).get
  9.   $socket($1,SOme **** to send).write
  10.   echo -a Sent $qt(Some **** to send)
  11.   $socket($1).delete
  12. }
  13. alias SockRead {
  14.   var %data
  15.   sockread %data
  16.   echo -a Read $len(%data) bytes from socket $Socket($1).tag $+ : %data
Add Comment
Please, Sign In to add comment