File: SFibClient.java

package info (click to toggle)
concurrent-dfsg 1.3.4-6
  • links: PTS
  • area: main
  • in suites: bookworm
  • size: 976 kB
  • sloc: java: 10,704; xml: 49; makefile: 12
file content (18 lines) | stat: -rw-r--r-- 473 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

import java.net.*;
import java.io.*;

public class SFibClient {

  public static void main(String[] args) {
    try {
      Socket s = new Socket("gee.cs.oswego.edu", 1618);
      DataInputStream i = new DataInputStream(s.getInputStream());
      DataOutputStream o = new DataOutputStream(s.getOutputStream());
      o.writeInt(34);
      int answer = i.readInt();
      System.out.println("Answer " + answer);
    }
    catch (Exception e) { e.printStackTrace(); }
  }
}