Adobe 12040118 Using Help - Page 225
Chat server sample
UPC - 718659361808
View all Adobe 12040118 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 225 highlights
Adobe After Effects Help Using Help The Socket Object Back 225 Read up to the given number of characters from the connection. Returns a string that contains up to the number of characters that were supposed to be read. If no count is supplied, the connection attempts to read as many characters it can get until the remote server closes the connection or a timeout occurs. Parameters count Number The number of characters to read. If no count is supplied, the connection attempts to read as many characters it can get until the remote server closes the connection or a timeout occurs. Returns String readln(); Read one line of text up to the next line feed. Line feeds are recognized as CR, LF, CRLF or LFCR pairs. Returns String write (String text, ...); Write the given string to the connection. The parameters of this function are concatenated to a single string. Returns true on success. Parameters text String All arguments are concatenated to form the string to be written. Returns Boolean writeln (String text, ...); Write the given string to the connection and append a Line Feed character. The parameters of this function are concatenated to a single string. Returns true on success. Parameters text String All arguments are concatenated to form the string to be written. Returns Boolean Chat server sample The following sample code implements a very simple chat server. A chat client may connect to the chat server, who is listening on port number 1234. The server responds with a welcome message and waits for one line of input from the client. The client types some text and transmits it to the server who displays the text and lets the user at the server computer type a line of text, which the client computer again displays. This goes back and forth until either the server or the client computer types the word "bye". Using Help Back 225