tcp-ip

Simple sending .txt file from one computer to another via TCP/IP

丶灬走出姿态 提交于 2019-12-02 11:06:10
There are two C# projects: one project is for the client, the other one is for the server. First step is to run the server , then to choose a target folder, after that to run the client project, to choose some text.txt to send to the server's target folder. Only client can send files to the server Demo: 1.choosing file target 2.client sends +------------+ | tar folder | <---------------- text.txt +------------+ My problem: there isn't compile errors or syntax errors in both projects, the only problem is that the server doesn't receives the .txt file. Client: First I designed a form for the

ADB TCPIP Connecting trouble

喜你入骨 提交于 2019-12-02 09:08:13
I have two Galaxy S3. One of them is rooted and the other one is not. So, when I tried to connect them over the local network, computer can see the rooted one. But normal one stucks on the tcpip step. So, I write adb tcpip 5555 It says restarting in TCP mode port : 5555 but nothing else. Can you help me with these? Note: My OS is Win8. After running adb tcpip 5555 What is the ouput when you try to run the "connect" command to the devices based on knowing the IP of the phone e.g. adb connect 192.168.1.186 should result in something like: connected to 192.168.1.186:5555 Also, make sure you have

Are there any TCP/IP stack implementations on top of Bluetooth for Java, more specificaly for Android?

↘锁芯ラ 提交于 2019-12-02 06:17:28
What I need to do is pair with a Bluetooth enabled device which hosts some webservices and browse for DNS-SD services. Then I have to pick one of those discovered services and make some http requests over https or other secure method. I already did this trough WiFi, but for some reasons there's a need to do the same trough Bluetooth. I did some research yesterday but I haven't found what I need. I'm not sure how to approach this. Any input on this is welcomed. Thanks! Most implementations of bluetooth implement sockets on top of RFCOMM or L2CAP, but these are not standard sockets. I've never

Cannot send and receive data using BufferedReader/Writer on sockets

廉价感情. 提交于 2019-12-02 06:10:48
问题 I am making a client-server application and am using the following code for the exchange of data b/w the server and clients. Server's send and receive code: public void run() { try { BufferedReader input = new BufferedReader(new InputStreamReader(socketNew.getInputStream())); String message=input.readLine(); while(message.length()!=0) { for(Socket s:socs) //socs is a list containing all the connected sockets { BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(s.getOutputStream

Error 'null' in sockets connection , Android [duplicate]

强颜欢笑 提交于 2019-12-02 02:45:02
问题 This question already has answers here : How do I fix 'android.os.NetworkOnMainThreadException'? (55 answers) Closed 3 years ago . What I was trying to do: I was trying to build a test app, for now, simply establishing connection between the app on Android phone (4.2.2)(as client) and a java application running on pc (windows 8)(as server) via sockets connection. What I've done already: I've made the programs for both client and server in java on pc and tested them positively (Connection got

Error 'null' in sockets connection , Android [duplicate]

狂风中的少年 提交于 2019-12-02 01:09:27
This question already has an answer here: How do I fix 'android.os.NetworkOnMainThreadException'? 54 answers What I was trying to do: I was trying to build a test app, for now, simply establishing connection between the app on Android phone (4.2.2)(as client) and a java application running on pc (windows 8)(as server) via sockets connection. What I've done already: I've made the programs for both client and server in java on pc and tested them positively (Connection got established). The network: Both my phone and pc are connected to wifi at my home. ipconfig on pc shows address 192.168.56.1

Cannot send and receive data using BufferedReader/Writer on sockets

亡梦爱人 提交于 2019-12-02 01:08:37
I am making a client-server application and am using the following code for the exchange of data b/w the server and clients. Server's send and receive code: public void run() { try { BufferedReader input = new BufferedReader(new InputStreamReader(socketNew.getInputStream())); String message=input.readLine(); while(message.length()!=0) { for(Socket s:socs) //socs is a list containing all the connected sockets { BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(s.getOutputStream())); writer.write(message); } } } catch (IOException e) { // TODO Auto-generated catch block e

Receive an object over TCP/IP

雨燕双飞 提交于 2019-12-01 19:43:51
I am going to write a program over TCP/IP and I should send objects by client or by server, It is going right when I want to send or receive strings but when I am trying to read an object: private Socket client; public ThreadedClient(Socket client) { this.client = client; } @Override public void run() { try { ObjectInputStream objIn = new ObjectInputStream(client.getInputStream()); while(true){ try { Object fromClient = objIn.readObject(); } catch (ClassNotFoundException e) {e.printStackTrace();} } } catch (IOException e) {e.printStackTrace();} } I receive an exception: java.io

Why MQTT is called as “light weight” messaging protocol?

旧时模样 提交于 2019-12-01 18:23:48
问题 As per Wikipedia and Mqtt.org, MQTT is a machine-to-machine (M2M)/"Internet of Things" connectivity protocol. It was designed as an extremely lightweight publish/subscribe messaging transport. In comparison with other TCP/IP or socket based protocols, what makes MQTT "extremely light-weighted"? 回答1: The protocol overhead of MQTT is extremely small, the smallest packet has only 2 bytes overhead. The payload-to-overhead ratio is typically extremely good. It's also a binary protocol which

My SQL server discovery on LAN by listening port (Inno Setup)

与世无争的帅哥 提交于 2019-12-01 00:53:34
I need to search for an IP address with Listening Port to look up for others PC on LAN (try to discovery MySQL server) and get the results IP who has that port listening. Something similar to this code to test sockets but working in Inno Setup: program pfinger; uses sockets,errors; Var Addr : TInetSockAddr; S : Longint; Sin,Sout : Text; Line : string; begin Addr.sin_family:=AF_INET; { port 79 in network order } Addr.sin_port:=79 shl 8; { localhost : 127.0.0.1 in network order } Addr.sin_addr.s_addr:=((1 shl 24) or 127); S:=fpSocket(AF_INET,SOCK_STREAM,0); If Not Connect (S,ADDR,SIN,SOUT) Then