Questions tagged [localserversocket]

12 questions
5
votes
3 answers

Talking to C socket with Scapy

I have a UDP connection up and listening on a port (localhost) and I am trying to send a Scapy packet from localhost as well. For some reason, my C code never actually captures the packet, however I can see the packet show up in Wireshark just fine.…
Josh Bradley
  • 4,630
  • 13
  • 54
  • 79
5
votes
5 answers

"IOException: Try again" while using LocalServerSocket

Does anybody have more helpful information on the Exception "Try again"? I'm sending Bitmaps between apps using LocalServerSocket and LocalSocket: Output: socket = new LocalSocket(); socket.connect(new LocalSocketAddress(SOCKET_NAME)); fos = new…
Graeme
  • 25,714
  • 24
  • 124
  • 186
2
votes
1 answer

Can't establish connection to localhost when offline

I build a webserver on my android device by NanoHttpd or ServerSocket and connect to this server from itself. It run good when device is online. But I can't receive request when device isn't online. I was try connect to localhost or 127.0.0.1 but…
Luc Le
  • 196
  • 9
2
votes
4 answers

Need Clarification in the socket server while loop

Below is a part of code from my socket server. I am not clear about some steps so I have some questions. My questions are below: Why I need to use while (1)? What is the purpose of exit (-1), will it close my socket? Why the data_len is…
user3751012
  • 533
  • 1
  • 8
  • 20
1
vote
2 answers

TCP - How to play a java game between two players on localhost server

I have made a game named Two Dice Pig in java. The game has a simple GUI interface showing two dice faces as well as both players scores and names. The game starts with the simple dialog message asking for both players' name and the game starts.…
SHEIKH
  • 25
  • 6
1
vote
0 answers

Android local video server

I am trying to make a local web server using socket that will stream a video. Following is my code for server: class VideoStreamServer { public void startServer() { outFile = new File(outFilePath); Runnable…
Sachin Chandil
  • 17,133
  • 8
  • 47
  • 65
1
vote
0 answers

ECONNRESET (Connection reset by peer) observed when writing to local ServerSocket's OutputStream

Hi guys I have read the answer to similar question but none of this could solve the problem im facing . Step 1.) I make a ServerSocket (localhost port8675) , I accept the socket and get its corresponding OutputStream (I use async task…
amIT
  • 664
  • 13
  • 27
0
votes
0 answers

How to start ServerSocket on a static ip?

UPDATE: The hotspot created on oreo and below has static IP which is 192.168.43.1. This is a change in Android 9 and above. and i want to do it for Android 9. I need to run ServerSocket on a static IP address. My scenario is that i need to access my…
0
votes
1 answer

C - cannot bind server socket

I'm writing a local client-server application in C, running on a 64bit Windows 7 machine. My problem is that when I call bind() for the server socket, it always returns -1 and I can't seem to figure out why. I tried using setsockopt with…
0
votes
1 answer

Initialize LocalServerSocket with SOCKET_SEQPACKET socket type

Is there a way to initialize an android LocalServerSocket with SOCKET_SEQPACKET type to avoid handling packet boundaries?
Eldar
  • 149
  • 2
  • 12
0
votes
1 answer

I can't assign more than one Address in java ServerSocket

Thanks for helping me. I am trying to run more than one server in my java program with this code: addr = InetAddress.getByName("127.0.0."+MyIP); ss = new ServerSocket(port,100,addr); but the code works for just MyIP=1,is there a way to solve this?
shadi
  • 11
  • 1
-1
votes
1 answer

Chatting on three or four computers via LAN cables

I have made a chat App using node.js and Soket.Io. To use my chat App you just enter your name and then you can start chatting. I can chat by two names in differrent browser of my computer. Now I want to connect three-four computers of my friends…
Abhishek Kaushik
  • 1,121
  • 1
  • 13
  • 17