I hava a socket server is written in Java and the client is written in C#.
If I use the InputStream in a socket server, I can get the request from the Client. My code as below:
InputStream myIN = sock.getInputStream();
byte[] b = new byte[10];
int revByte = myIN.read(b);
but if I use the ObjectInputStream in the socket server, I c...
My server use UDP. It sends 900bytes/1ms to my program automatically after being acquired. I'm using socket API in Windows (VB 6). I had made a test and I know that the message processing time (about 0.3ms) of my program is shorter than cycle time (1ms). So the cause should be socket internal buffer. I try calling setsockopt function to ...
Let's say I have a server socket listening on port no 5010. When client tries to connect to this server socket using connect() API, server accepts socket connection in accept() API.
accept() API returns a new socket for server/client connection. Now all data transfer between server and client is done using this newly created socket. D...
I already did a bit of research & tried a few things... but still can't find how to programmatic detect if there are any bytes (that maybe already be awaiting inside the outgoing queue) which had not been transmitted to the cable.
Thanks
...
Hello,
In Linux, one can specify the system's default receive buffer size for network packets, say UDP, using the following commands:
sysctl -w net.core.rmem_max=<value>
sysctl -w net.core.rmem_default=<value>
But I wonder, is it possible for an application (say, in c) to override system's defaults by specifying the receive buffer si...
Hey hi guys,
i am new to network programming in python. I wanted to know that what is the maximum size packet we can transmit or receive on python socket? and how to find out it?
...
i am designing a card game.. multiple clients will connect to a single server object. should i store the instance variables in the protocol or the server object?
...
Hello,
I am programming a client and server in Java where the client sends a request to create a Certificate. This request contains a lot of different datatypes including byte [], the way that I am doing it now is by using ObjectStreams like :
objectStream.writeObject( new String("value of field1"));
objectStream.flush();
objectStream....
When I try to add a strServerIP to the class Server, I get a:
Cannot resolve symbol string
compiler error.
Why?
package com.example;
public class Server
{
//public static java.lang.string SERVERIP;
public static android.R.string SERVERIP;
public static java.lang.string strServerIP = "monster.idsoftware.com";
public s...
For example http://www.utorrent.com/testport?port=12345
How does this work? Can the server side script attempt to open a socket?
...
I am reading and write XML over a TCP connection (not HTTP) as part of a web service I'm developing, and I was wondering whether there is a more "springified" way (or even other ideas) of achieving what I'm trying below:
InputStream is = null;
OutputStream os = null;
Socket s = null;
try {
s = new Socket(address,...
Can someone please explain me why the following code doesn't work?
using System;
using System.Collections.Generic;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.Threading;
namespace SocketThreadingTest
{
class Program
{
static void Main(string[] args)
{
Thread t = new Th...
To create a client-server GAME applications in Flash, which would be more practical to use and faster in terms of client-server data exchange:
a. web services (flash / flex the client and PHP the server)
or
b. socket connection (flash / flex the client and C / C + + the server)
Any help is welcome.
Thanks.
...
I want a Flash file to load external movies. Later, I want to add tags to the XML document to control the movies. I have a policy server file "to open a port for Flash client. I also have a file to load, but I don't have a Flash client built to receive the file.
Ultimately, I can control Flash from a Ruby server and talk to it with an X...
I am opening socket on windows platform for sending RTP voice packets. The application is softphone. What preferable options should be set on this socket.
...
I do a:
java.net.InetAddress serverAddr;
try {
serverAddr = java.net.InetAddress.getByName(Server.SERVERNAME);
}
catch (java.net.UnknownHostException exception) {
//System.err.println ("wrong server name !!!");
HelloWorldActivity.tv.setText("wrong server name !!!");
return;
}
in my android application, but it's never r...
I use java ServerSocket class for server application.
Does accept() method participate in tcp/ip handshake?
As I see in tcp/ip dump and from command netstat, clients establish connections with before accept method is called and return Socket object.
Is it java issue, or I do not understand accept() semantics?
...
Hi,
I am using socket /TcpClient to send a file to a Server as below
NetworkStream nws = tcpClient.GetStream();
FileStream fs;
fs = new FileStream(filename, FileMode.Open, FileAccess.Read);
byte[] bytesToSend = new byte[fs.Length];
int numBytesRead = fs.Read(bytesToSend, 0, bytesToSend.Length);...
Hi,I can not get why it uses two different socket please help me thanks.
The client would request a file through socket 9123
from the server, the server would then send the file to the client through socket 8123 on
which every client would be listening once it requests a file.
...
Hi
I have a script that connects to a remote server. The code is below
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((remote_host,remote_port))
s.setblocking(False)
while True:
try:
data = s.recv(1024)
if not data:
break
pkt_type = ord(data[2]) # get pkt type
if pkt_...