Processing, 類Client
中的write()
用法介紹。
用法
client.write(data)
參數
client
(Client)
客戶端類型的任何變量data
(int, byte[], String)
要寫入的數據
返回
void
說明
將數據寫入構建客戶端時指定的服務器,或將數據寫入從服務器available()
方法獲得的特定客戶端。
例子
// Creates a client that sends input to a server
import processing.net.*;
Client myClient;
int clicks;
void setup() {
// Connect to the local machine at port 10002.
// This example will not run if you haven't
// previously started a server on this port.
myClient = new Client(this, "127.0.0.1", 10002);
// Say hello
myClient.write("Hi there");
}
void mouseReleased() {
// Count the number of mouse clicks:
clicks++;
// Tell the server:
myClient.write("Mouse pressed " + clicks + " times.\n");
}
void draw() {
// Change the background if the mouse is pressed
if (mousePressed) {
background(255);
} else {
background(0);
}
}
相關用法
- Processing Client.readStringUntil()用法及代碼示例
- Processing Client.active()用法及代碼示例
- Processing Client.ip()用法及代碼示例
- Processing Client.readString()用法及代碼示例
- Processing Client.readBytesUntil()用法及代碼示例
- Processing Client.read()用法及代碼示例
- Processing Client.clear()用法及代碼示例
- Processing Client.readBytes()用法及代碼示例
- Processing Client.stop()用法及代碼示例
- Processing Client.readChar()用法及代碼示例
- Processing Client.available()用法及代碼示例
- Processing Client用法及代碼示例
- Processing Capture.stop()用法及代碼示例
- Processing Capture.start()用法及代碼示例
- Processing Capture.available()用法及代碼示例
- Processing Capture.read()用法及代碼示例
- Processing Capture用法及代碼示例
- Processing FFT用法及代碼示例
- Processing SawOsc.pan()用法及代碼示例
- Processing FloatDict用法及代碼示例
- Processing FFT.stop()用法及代碼示例
- Processing join()用法及代碼示例
- Processing () (parentheses)用法及代碼示例
- Processing Pulse用法及代碼示例
- Processing PShader用法及代碼示例
注:本文由純淨天空篩選整理自processing.org大神的英文原創作品 Client.write()。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。