Jump to content

For newbie: Little client-server with comment


 Share

Recommended Posts

This is simply client/server :shocked:

for TCP/IP training

SERVER:

$title= "server"

TCPStartup()  ;Start TCP/IP

$serverSocket = TCPListen(@IPAddress1, 3031)  ;Use this IP and PORT for create my server

;the server is start


while 1
    Do
        $socketClient= TCPAccept($serverSocket)  ; I wait and accept a client on the IP and PORT previously  created
    Until $socketClient >= 0

    Do
        $data= TCPRecv($socketClient,500)  ; I wait a string from client
            if @error Then ExitLoop  ;the client is disconnect, I exit
    Until $data <> ""

    MsgBox(0,$title,$data)

    $data = InputBox($title & " -> ", "Insert a string")

    TCPSend($socketClient, $data) ;Send string to the server
        if @error Then ExitLoop ;the client is disconnect, I exit
WEnd


TCPShutdown();close TCP/IP connectionoÝ÷ Ù° CSý¶®¶­s`¢b33c·FFÆSÒgV÷C¶6ÆVçBgV÷C° ¥D57F'GW·7F'BD5ô6öææV7Föà ¢b33c·6W'fW%6ö6¶WBÒD56öææV7BFG&W73Â33·W6RF2æBF2÷'Bf÷"6öææV7BFòFR6W'fW"æ÷r26WBf÷"Æö6Â6öææV7Föâ £´æ÷rb33¶Ò6öææV7@  §vÆR  b33c¶FFÒçWD&÷b33c·FFÆRfײgV÷C²ÒfwC²gV÷C²ÂgV÷C´ç6W'B7G&ærgV÷C²  D56VæBb33c·6W'fW%6ö6¶WBÂb33c¶FF·6VæB7G&ærFò6W'fW  bW'&÷"FVâWDÆö÷·FR6W'fW"2F66öææV7FVBÂW@  Fð b33c¶FFÒD5&V7bb33c·6W'fW%6ö6¶WBÃS²vB7G&ærg&öÒ6W'fW  bW'&÷"FVâWDÆö÷·FR6W'fW"2F66öææV7FVBÂW@ VçFÂb33c¶FFfÇC²fwC²gV÷C²gV÷C°  ×6t&÷Âb33c·FFÆRÂb33c¶FF  ¥tVæ@  ¥D56WFF÷vâ²6Æ÷6RD5ô6öææV7Föà
Edited by Cyber
Console Browse: Navigate on the WEB in a textual consoleMultiPing!: Show computer on the lan and/or show the local/remote task, ALL animated!KillaWin: Event executingCryptPage: Crypt your webpage and show only with key
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...