About socket and port problem
hi,all.
i write a chat server use java socket. now is more than 2000 users connect to my server. but too many user make the chat message speed slow. now my server is open one port to listen the client connection. who can tell me if i change my server to open multi port to listen the client connection will rather than open one port. or it is same effect.
please give me some advice. thanks.
Maybe your machine is not strong enough to serve that many users at a time anyway. In that case using several ports won't help.
Similar Messages
-
Chatserver socket and port problem
hi,all.
i write a chat server use java socket. now is more than 2000 users connect to my server. but too many user make the chat message speed slow. now my server is open one port to listen the client connection. who can tell me if i change my server to open multi port to listen the client connection will rather than open one port. or it is same effect.
please give me some advice. thanks.
my homepage is:http://www.easyfad.commy server system resource is no problem. Have you timed the bus on your machine?
18% of memory means physical or total. If total is that 18% hitting the hard drive?
What is your actual network speed? A 100m ethernet has a theoretical speed of about 12 meg per second, in practice you will never get even close to that. A normal ftp transfer might only get 500k per second. And networks can be significantly overloaded.
What are the configuration parameters for your IP stack? It might be configured incorrectly for the type of traffic and quality of traffic that you are getting.
The above are all possible things that can affect performance. And there are probably more. Standard OS tools are NOT the best way to measure platform performance. They can often provide misleading numbers, even when one knows what the numbers really mean.
if i use multi port to create socket connection,
if it will help to increase message sending speed ? Like I said I can't see how. Something is causing a slowdown. Your NIC can only process so much traffic. If your NIC was the bottle neck and you had two NICs then that would help. But if it was me I really wouldn't try a two NIC solution until I had exhausted every other possibility. First because it is unlikely to the be bottleneck and two because setting up a 2 NIC (or more) server is not plug and go solution. -
I am new to socket programming. Is there a command in UNIX to see which ports are not occupied?
Since I have problem right now in my program to close the sockets, will they be closed automatically after I interrupt the program, should I close it manually from the command line?
TIA.
mmcWhen you create a Socket, you can either bind to port 0 (which binds to the first available port) or to any other valid Port number. There is no Java-based method for geting the port numbers in-use or available. When your program terminates, the sockets will terminate as well, but the port may not be available for use for a few seconds. This allows for the system to be reset.
-
Simple question about sockets and streams - please answer it!
Hi
I have a server socket and a client socket. Both are up and runing. But I'm having problems to send a string from the client and read only the four first bytes on the server. Please read the code and some other comments below:
socket client:
DataOutputStream out =
new DataOutputStream(socket.getOutputStream());
// read from keyboard input
BufferedReader myinput =
new BufferedReader(new InputStreamReader(System.in));
System.out.println("Type any 4 chars and [enter].");
String any = myinput.readLine();
out.writeBytes(any);
out.flush();
server socket:
in = new DataInputStream(socket.getInputStream());
byte[] id = new byte[4];
in.read(id, 0, 4);
System.out.print(new String(id));
According to the code, it should read 4 bytes from the input stream (in.read(id, 0, 4)), but it displays only the first byte. For example, if I type "hello" on client, the serve should show "hell" but it shows just "h"
Any ideias? Thanks!Hi,
Check the Javadoc for 'in.read(id, 0, 4);' This reads up to 4 bytes and returns the number of bytes read. You need something along the lines of
int count = 0;
while (count < 4)
count += in.read(id, count, 4-count);
Roger -
Sockets and ports - routing messages between machines? helpppp!
Hi,
I'm new to java and am hoping someone out there can help me, hoping this is an ok place to post this:
If all you need to create a connection is an IP address and a port number, using streams...
Can you route messages from A to B then from B to C, where A looks up C through B having a hash table which contains C's IP address and port number?
And how in the first instance does B know about A's IP address? All the examples I've seen the IP address is hard coded?
Thanks in advance!I'm not sure what you are really trying to do... Can you explain in more concrete terms? Are you writing a chat client + server or something like that?
-
Sockets and ports - how to route through another machine?
Hi,
I'm hoping someone out there can help me:
If all you need to create a connection is an IP address and a port number, using streams...
Can you route messages from A to B then from B to C, where A looks up C through B having a hash table which contains C's IP address and port number?
And how in the first instance does B know about A's IP address? All the examples I've seen the IP address is hard coded?
Thanks in advance!Ok, so i mean I know this is possible, but I have some users who need to communicate with each other, sorta a message passing approach but with TCP rather than using JMS (time to do this in is v limited).
They need to talk to a middle computer, whos job it is to lookup an appropriate partner to talk to, but:
how do i go about getting the IP address in the first place so that they know who to talk to?
Before communication can take place does there have to be some agreement in which they exchange IP addresses and port numbers? -
Whats socket and port ??
Hi,
iam new to sockets...
i dont know whats the difference between sockets and portshttp://java.sun.com/docs/books/tutorial/networking/sockets/definition.html
-
Verification on the asa 8.4 5505 about PAT and port forwarding.
hi all
ihae topology as blow :
inside------------eth0/1-------asa---eth0/7---------outside-------------------internet
my goal is
i want to make pat of inside network (10.66.12.0/24) with outside interface when it request the internet
also ,
i need port forwaridng to following hosts :
10.66.12.122 to 3389
10.66.12.249 to http
10.66.12.249 to https
10.66.12.249 to citrix
=============================================================
just m i need somebody to check my config it is correct
=============================================================
i have asda 5505 with :
ASAAAAA(config)# sh version
Cisco Adaptive Security Appliance Software Version 8.4(2)
Device Manager Version 6.4(5)
Compiled on Wed 15-Jun-11 18:17 by builders
System image file is "disk0:/asa842-k8.bin"
Config file at boot was "startup-config"
ASAAAAA up 1 hour 32 mins
Hardware: ASA5505, 512 MB RAM, CPU Geode 500 MHz
Internal ATA Compact Flash, 128MB
BIOS Flash M50FW016 @ 0xfff00000, 2048KB
Encryption hardware device : Cisco ASA-5505 on-board accelerator (revision 0x0)
Boot microcode : CN1000-MC-BOOT-2.00
SSL/IKE microcode : CNLite-MC-SSLm-PLUS-2.03
IPSec microcode : CNlite-MC-IPSECm-MAIN-2.06
Number of accelerators: 1
0: Int: Internal-Data0/0 : address is d48c.b597.ce35, irq 11
1: Ext: Ethernet0/0 : address is d48c.b597.ce2d, irq 255
2: Ext: Ethernet0/1 : address is d48c.b597.ce2e, irq 255
3: Ext: Ethernet0/2 : address is d48c.b597.ce2f, irq 255
4: Ext: Ethernet0/3 : address is d48c.b597.ce30, irq 255
5: Ext: Ethernet0/4 : address is d48c.b597.ce31, irq 255
6: Ext: Ethernet0/5 : address is d48c.b597.ce32, irq 255
7: Ext: Ethernet0/6 : address is d48c.b597.ce33, irq 255
8: Ext: Ethernet0/7 : address is d48c.b597.ce34, irq 255
9: Int: Internal-Data0/1 : address is 0000.0003.0002, irq 255
10: Int: Not used : irq 255
11: Int: Not used : irq 255
Licensed features for this platform:
Maximum Physical Interfaces : 8 perpetual
VLANs : 3 DMZ Restricted
Dual ISPs : Disabled perpetual
VLAN Trunk Ports : 0 perpetual
Inside Hosts : 50 perpetual
Failover : Disabled perpetual
VPN-DES : Enabled perpetual
VPN-3DES-AES : Enabled perpetual
AnyConnect Premium Peers : 2 perpetual
AnyConnect Essentials : Disabled perpetual
Other VPN Peers : 10 perpetual
Total VPN Peers : 25 perpetual
Shared License : Disabled perpetual
AnyConnect for Mobile : Disabled perpetual
AnyConnect for Cisco VPN Phone : Disabled perpetual
Advanced Endpoint Assessment : Disabled perpetual
UC Phone Proxy Sessions : 2 perpetual
Total UC Proxy Sessions : 2 perpetual
Botnet Traffic Filter : Disabled perpetual
Intercompany Media Engine : Disabled perpetual
This platform has a Base license.
Serial Number: JMX162740GP
Running Permanent Activation Key: 0x6801f547 0xe81c57c4 0x20f339f4 0xaaf48040 0x
480e2fbc
Configuration register is 0x100003
Configuration last modified by enable_15 at 23:58:15.999 UTC Wed Jan 22 2014
ASAAAAA(config)# sh run
: Saved
ASA Version 8.4(2)
hostname ASAAAAA
enable password ffffCCSH encrypted
passwd 2KFfffff2KYOU encrypted
names
interface Ethernet0/0
interface Ethernet0/1
interface Ethernet0/2
interface Ethernet0/3
interface Ethernet0/4
interface Ethernet0/5
interface Ethernet0/6
interface Ethernet0/7
switchport access vlan 2
interface Vlan1
nameif ins
security-level 100
ip address 10.66.12.1 255.255.255.0
interface Vlan2
nameif outside
security-level 50
ip address x.x.55.34 255.255.255.248
boot system disk0:/asa842-k8.bin
ftp mode passive
same-security-traffic permit inter-interface
same-security-traffic permit intra-interface
object network obj_any
subnet 0.0.0.0 0.0.0.0
object network obj-0.0.0.0
host 0.0.0.0
object network localsubnet
subnet 10.66.12.0 255.255.255.0
description localsubnet
object network HTTP-Host
host 10.66.12.249
description web server
object network HTTPS-HOST
host 10.66.12.249
description Https
object network RDP-Host
host 10.66.12.122
description RDP host
object network citrix-host
host 10.66.12.249
description citrix
object service rdp
service tcp destination eq 3389
object service https
service tcp destination eq https
object service citrix
service tcp destination eq 2598
object service http
service tcp destination eq www
object-group network RDP-REDIRECT
object-group network HTTP-REDIRECT
object-group network HTTPS-REDIRECT
object-group network CITRIX-ICA-HDX-REDIRECTION
object-group network CITRIX-ICA-SESSION-RELIABILITY-REDIRECTION
object-group service CITRIX-ICA-HDX
object-group service CITRIX-SR
object-group service RDP
object-group network MY-insideNET
network-object 10.66.12.0 255.255.255.0
object-group service DM_INLINE_SERVICE_1
service-object object citrix
service-object object http
service-object object https
service-object object rdp
access-list outside_access_in extended permit object-group DM_INLINE_SERVICE_1 a
ny interface outside
pager lines 24
mtu ins 1500
mtu outside 1500
icmp unreachable rate-limit 1 burst-size 1
asdm image disk0:/asdm-645.bin
no asdm history enable
arp timeout 14400
nat (ins,outside) source static RDP-Host interface service rdp rdp
nat (ins,outside) source static HTTP-Host interface service http http
nat (ins,outside) source static citrix-host interface service citrix citrix
object network obj_any
nat (ins,outside) dynamic obj-0.0.0.0
object network localsubnet
nat (ins,outside) dynamic interface
access-group outside_access_in in interface outside
route outside 0.0.0.0 0.0.0.0 x.x.55.33 1
timeout xlate 3:00:00
timeout conn 1:00:00 half-closed 0:10:00 udp 0:02:00 icmp 0:00:02
timeout sunrpc 0:10:00 h323 0:05:00 h225 1:00:00 mgcp 0:05:00 mgcp-pat 0:05:00
timeout sip 0:30:00 sip_media 0:02:00 sip-invite 0:03:00 sip-disconnect 0:02:00
timeout sip-provisional-media 0:02:00 uauth 0:05:00 absolute
timeout tcp-proxy-reassembly 0:01:00
timeout floating-conn 0:00:00
dynamic-access-policy-record DfltAccessPolicy
user-identity default-domain LOCAL
aaa authentication http console LOCAL
aaa authentication ssh console LOCAL
aaa authentication telnet console LOCAL
http server enable
http 10.66.12.0 255.255.255.0 ins
http 0.0.0.0 0.0.0.0 outside
no snmp-server location
no snmp-server contact
snmp-server enable traps snmp authentication linkup linkdown coldstart
crypto ca trustpoint _SmartCallHome_ServerCA
crl configure
crypto ca certificate chain _SmartCallHome_ServerCA
certificate ca 6ecc7aa5a7032009b8cebcf4e952d491
308205ec 308204d4 a0030201 0202106e cc7aa5a7 032009b8 cebcf4e9 52d49130
0d06092a 864886f7 0d010105 05003081 ca310b30 09060355 04061302 55533117
30150603 55040a13 0e566572 69536967 6e2c2049 6e632e31 1f301d06 0355040b
13165665 72695369 676e2054 72757374 204e6574 776f726b 313a3038 06035504
0b133128 63292032 30303620 56657269 5369676e 2c20496e 632e202d 20466f72
20617574 686f7269 7a656420 75736520 6f6e6c79 31453043 06035504 03133c56
65726953 69676e20 436c6173 73203320 5075626c 69632050 72696d61 72792043
65727469 66696361 74696f6e 20417574 686f7269 7479202d 20473530 1e170d31
30303230 38303030 3030305a 170d3230 30323037 32333539 35395a30 81b5310b
30090603 55040613 02555331 17301506 0355040a 130e5665 72695369 676e2c20
496e632e 311f301d 06035504 0b131656 65726953 69676e20 54727573 74204e65
74776f72 6b313b30 39060355 040b1332 5465726d 73206f66 20757365 20617420
68747470 733a2f2f 7777772e 76657269 7369676e 2e636f6d 2f727061 20286329
3130312f 302d0603 55040313 26566572 69536967 6e20436c 61737320 33205365
63757265 20536572 76657220 4341202d 20473330 82012230 0d06092a 864886f7
0d010101 05000382 010f0030 82010a02 82010100 b187841f c20c45f5 bcab2597
a7ada23e 9cbaf6c1 39b88bca c2ac56c6 e5bb658e 444f4dce 6fed094a d4af4e10
9c688b2e 957b899b 13cae234 34c1f35b f3497b62 83488174 d188786c 0253f9bc
7f432657 5833833b 330a17b0 d04e9124 ad867d64 12dc744a 34a11d0a ea961d0b
15fca34b 3bce6388 d0f82d0c 948610ca b69a3dca eb379c00 48358629 5078e845
63cd1941 4ff595ec 7b98d4c4 71b350be 28b38fa0 b9539cf5 ca2c23a9 fd1406e8
18b49ae8 3c6e81fd e4cd3536 b351d369 ec12ba56 6e6f9b57 c58b14e7 0ec79ced
4a546ac9 4dc5bf11 b1ae1c67 81cb4455 33997f24 9b3f5345 7f861af3 3cfa6d7f
81f5b84a d3f58537 1cb5a6d0 09e4187b 384efa0f 02030100 01a38201 df308201
db303406 082b0601 05050701 01042830 26302406 082b0601 05050730 01861868
7474703a 2f2f6f63 73702e76 65726973 69676e2e 636f6d30 12060355 1d130101
ff040830 060101ff 02010030 70060355 1d200469 30673065 060b6086 480186f8
45010717 03305630 2806082b 06010505 07020116 1c687474 70733a2f 2f777777
2e766572 69736967 6e2e636f 6d2f6370 73302a06 082b0601 05050702 02301e1a
1c687474 70733a2f 2f777777 2e766572 69736967 6e2e636f 6d2f7270 61303406
03551d1f 042d302b 3029a027 a0258623 68747470 3a2f2f63 726c2e76 65726973
69676e2e 636f6d2f 70636133 2d67352e 63726c30 0e060355 1d0f0101 ff040403
02010630 6d06082b 06010505 07010c04 61305fa1 5da05b30 59305730 55160969
6d616765 2f676966 3021301f 30070605 2b0e0302 1a04148f e5d31a86 ac8d8e6b
c3cf806a d448182c 7b192e30 25162368 7474703a 2f2f6c6f 676f2e76 65726973
69676e2e 636f6d2f 76736c6f 676f2e67 69663028 0603551d 11042130 1fa41d30
1b311930 17060355 04031310 56657269 5369676e 4d504b49 2d322d36 301d0603
481d22cd 0b0b8bbc f4b17bfd b499a8e9 762ae11a 2d876e74 d388dd1e 22c6df16
b62b8214 0a945cf2 50ecafce ff62370d ad65d306 4153ed02 14c8b558 28a1ace0
5becb37f 954afb03 c8ad26db e6667812 4ad99f42 fbe198e6 42839b8f 8f6724e8
6119b5dd cdb50b26 058ec36e c4c875b8 46cfe218 065ea9ae a8819a47 16de0c28
6c2527b9 deb78458 c61f381e a4c4cb66
quit
telnet timeout 5
ssh timeout 5
console timeout 0
threat-detection basic-threat
threat-detection statistics access-list
no threat-detection statistics tcp-intercept
webvpn
username ADMIN password 5iEuCUW0P3ThngqY encrypted privilege 15
username cisco password eT0.bmvcLOAQcNEL encrypted privilege 15
prompt hostname context
call-home reporting anonymous
call-home
profile CiscoTAC-1
no active
destination address http https://tools.cisco.com/its/service/oddce/services/DD
CEService
destination address email [email protected]
destination transport-method http
subscribe-to-alert-group diagnostic
subscribe-to-alert-group environment
subscribe-to-alert-group inventory periodic monthly
subscribe-to-alert-group configuration periodic monthly
subscribe-to-alert-group telemetry periodic daily
Cryptochecksum:65c9b8c35749959d1159e162ff106166
: end
=======================================================
i configured PAT , PORTFORWARD and ACCESS RULES
just want to mae verification to my work
regardsHi,
Dont think I can really give you an answer but thought I'd write anyway.
It does seem on the basis of the documentation of the ASA (8.4) that with Twice NAT you wont be able to do any modifications to the DNS replies.
Heres one quote from Configuration Guide
Gonfiguring Network Address Translation -> Information About NAT -> DNS and NAT
If you configure a twice NAT rule, you cannot configure DNS modification if you specify the sourceaddress as well as the destination address. These kinds of rules can potentially have a differenttranslation for a single address when going to A vs. B. Therefore, the ASA cannot accurately match theIP address inside the DNS reply to the correct twice NAT rule; the DNS reply does not containinformation about which source/destination address combination was in the packet that prompted theDNS request.
So if I'm not totally wrong I guess your options might be to either
Start doing changes to the local DNS server directly?
Separate the remote overlapping network from your current firewall with another firewall device?
I dont know the whole setup so this might be impossible
Thinking that if the NAT for the remote overlapping network was done on another firewall it could do the DNS reply changes before they arrived on your ASA from the remote DNS server?
I have not really had to tackle such a situation before. I most commonly run into situations where a customer has public IP configured with 1:1 Static NAT and there is no DNS parameter in the Static NAT configuration while the customer tries to use the DNS name to connect to their local server.
Just some of my thoughts. Maybe someone else might have more expirience with same type of situations.
- Jouni -
Smtp and port problems--cant use email
Using OSX 10.4.9, Total Access 2003 1.0
Oct 19 was the last email received through Mac mail. Using Earthlink.net for email. Contacted Earthlink several times, as there was a problem with "Cannot send message using the server smtpauth.earthlink.net" There was a problem with port 25, so i switched to port 587. There is still a problem, and Earthlink now says that it is an Apple problem, not an Earthlink problem
I upgraded to Tiger early summer, and have had no problems, until Oct 19, when it just stopped.
I am very frustrated and want to use MacMail instead of Earthlink's WebMail. I need to know how to fix it,Hello, mnkeen.
This post may repeat things you have already tried, but I am replying just in case. In addition, I hope I am reading your message correctly.
One of my mail providers is Earthlink; however, I do not use TotalAccess.
• Go to www.earthlink.net
• Click on Support at the top of the page.
• Under Top Solutions select "Setting Up Your Email Program."
• Special Note: You are not going to set up an email program; you are just using the article for research.
• Scroll down to Setting Up Another Mail Client for EarthLink Access and select Mac OS X Mail 1.4.
1. Get the server settings if you need them.
23. through 31. Compare the pictures with your settings.
29. As you write that you have already set the Server Port to 587, I am wondering if the snag you are experiencing is in the selection of the Authentication option.
For what it is worth, my home network uses MD 5 Challenge-Response.
Other things to check:
• Under Top Solutions you may also want to select "Troubleshooting Email Problems."
• Maybe the links to "Configuring your email for SMTP Authentication (This is now required for Earthlink email accounts)" and / or "Changing email settings" might be of use to you.
• Both of those articles include specific information and pictures for Mac OS X Mail.
Sincerely,
No Alibi. -
Backup or Clone Stalls at about 200GB and other problems
I cannot backup more than about 210GB out of 440GB on a 500GB boot drive. I have tried Disk Utility to create a clone of my boot drive and I have tried SuperDuper! to do the same thing. I have tried creating a clone on another internal drive and I have tried to create a clone to an external drive. No matter which drive or disk software I use, the backup proceeds quickly (25 to 50 MB/sec depending upon the drive) until it reaches a little more 200GB, then the backup stalls. In the case of Disk Utility, all of my Application and Library files are captured correctly, but my User files are not. SuperDuper! Starts at the bottom of the drive directory and captures most or all of my User files, but SuperDuper stalls when it reaches the Application and System files (including Library files). In both cases, as I mentioned above, 205GB to 212GB are transferred before the backup stalls.
My hardware config is just below and other symptoms are shown below that.
2006 MacPro
Model Name: Mac Pro (September 2006)
Model Identifier: MacPro1,1
Processor Name: Dual-Core Intel Xeon
Processor Speed: 2.66 GHz
Number Of Processors: 2
Total Number Of Cores: 4
L2 Cache (per processor): 4 MB
Memory: 10 GB
Bus Speed: 1.33 GHz
Boot ROM Version: MP11.005C.B08
SMC Version (system): 1.7f10
Two 1TB Drives configured as one 1TB RAID Set (software RAID)and used for Video and Photos
Two 500GB drives. One is the boot drive and one was being used as a Time Machine backup drive until I started having problems.
• Apple’s “Backup” Software does not complete a backup designed to copy Microsoft Office and Apple iWork files. The software scans more than six million files (there are only 900,000 files on my hard drive) and then fails.
• The computer will not boot from the Mac Pro Install Disk. Every attempt leads to descending dark gray scree with the message, “You need to restart your computer.”
• I cannot empty the Trash. I usually keep Trash empty, so there are never very many files in Trash. Recently I tried to empty the trash and the system started to count files to be removed an it quickly reached one million files after which I “Force Quit” Finder to stop it.
• My computer was going to sleep frequently despite Preference Settings designed to prevent any sleep at all. I thought this was interrupting the backup processes, despite the fact that SuperDuper, at least, seems to stave off the computer’s attempt to sleep. I installed Caffeine and that stopped the unrequested sleep behavior, but did not solve the backup problem.
• Recently my computer failed to find the boot drive. When this happens I can hold the “option” key during boot and select the boot drive myself.
• I have reset the PRAM and VRAM.
• The Install disk Extended Hardware test does not find a problem.
• Disk utility does not find a problem with the boot drive although a small number of disk permissions always need to be fixed when I run Repair Disk Permissions. Most, but not all of the failed and then repaired permissions are related to Java. One is related to Parental Controls.
• I reinstalled the OS by downloading and executing the Mac OS X 6.5 Combo update.
• I have not installed any new hardware for about a year.
• I am running Disk Warrior right now but it has not completed its check yet
• I have started to use DropBox to protect my User files (mostly Office and pdf files)—get them off the computer, but I am worried about restoring my Applications if I “lose” the system.Thanks to all of you; I appreciate your expertise and the time you take to help me out. I have made progress. Let me start by saying that my system has 10GB of DRAM memory. One of you commented that I might have needed more disk swap space, but I don't think this is likely. I do think file corruption is a possibility. I am interested in all of your comments but first, will you please explain this in more detail?
"Rebuilding the extensions drivers which are in a cache file, thru Safe Boot, may help - a good driver when installed should force the mkext to rebuild or be deleted, but not all do."
Now, here is the update that I provided to SuperDuper!... In my update I commented that Trash had many more than a million files in it--I think six million. When I deleted the application mentioned below, there is no way that I had that many files, or that much content associated with the app--something pathological happened. My system stability has improved but I will watch for a few more days before I declare victory. In a few days I will do a file system rebuild on the boot drive using DiskWarrior, but I am interested in learning what all of you think might be a better maintenance procedure.
----------------------<snip>----------------------------------
I fixed the problem and SuperDuper successfully ran a full backup.
I bought and ran DiskWarrior which showed that one directory in my .Trash file had about ten sub-directories in it and each one had more than 100,000 files. I think the true number might have been six times that. The directory in Trash was attributed to an application that I deleted recently--SugarSync.
I ran this UNIX command: rm -rf ~/.Trash. It took many hours to complete. When completed I was surprised to see that about 200GB had disappeared from my boot drive--all from Trash and nothing I care about. I ran DiskWarrior again and got a clean report. I repaired disk permissions, re-booted and ran SuperDuper immediately. It copied 249GB in 1:59:00 to an internal drive.
Time Machine now also works.
I think I have some more cleanup to do but I appreciate your help. -
About localhost and port number
following jdbc:microsoftLsqlserver:// , why is the host name localhost and the port number is 1433? how to change the port number into others? please help
thanks"localhost" is usually but not always set up as a hostname for current host, and resolves to the IP address 127.0.0.1
You can connect to any host or port you want (that has a database running on that port), just change the values in the connection URL.
If your question is "how can I get SQL Server to run using a different port", you'll need to consult Microsoft's documentation for that. -
Socket and multithreading problem (flow control)
This code is heavily influenced by the KKMultiServerThread. I am having problems controlling the thread flow.
login = new MultiServerThreadLogin(serverSocket.accept(), serverSocket);
login.start();
while(true){
System.out.println(login.getAuthen());
while(login.getAuthen()){
System.out.println("doing hello");
hello = new KKMultiServerThread(serverSocket.accept(), serverSocket);
hello.start();
if(hello.getFlag())
break;
}here, you can see that i am trying to start a thread to login the user and then recieve files from the cilent. When my GUI runs, there is no problem whatsoever that is for the 1st time, however when i try running the 2nd time, the code as u can see, doesnt allow that... so is there anyway to break away from the inner loop?hey thanks for replying... i'm sorry but in a rush here...
this snippet resides in the server. There are 2 classes, namely MultiServerLoginThread and KKMultiServerThread, both extends Thread.
The function of the MultiServerLoginThread is to read in bytes of Secretkey, username(encrypted) and password(encrypted). This should only take place once.
The function of theother thread, KKMultiServerThread is to read in the file name to be transferred and the contents. This is based on the KKMultiServerThread which can be found somewhere in this forum... i hope...
The KKMultiServerThread is started over and over because the client is sending multiple files. Hence the while loop. However after sending the last file, it should go to the MultiServerLoginThread....
One thing i don't really get it is that if i were to do this(put the creation of the login thread within the while loop):
while(true){
System.out.println(login.getAuthen());
login = new MultiServerThreadLogin(serverSocket.accept(), serverSocket);
login.start();
while(login.getAuthen()){
System.out.println("doing hello");
hello = new KKMultiServerThread(serverSocket.accept(), serverSocket);
hello.start();
if(hello.getFlag())
break;
}The GUI totally hangs.
More explanation...
hello.getFlag() returns the flag when the client has finished sending all the files
login.getAuthen() returns whether the user has successfully logged in with correct creditials -
Sockets and Ports and DataInputStreams
I think this is just a basic TCP/IP networking question: When I open a socket connection to a remote ip address/port, what port am i receiving data on via my DataInputStream? Is it the same port I opened the remote connection on, 80, or what?
thanks,
Abrahamint answer = yourSocket.getLocalPort();
-
When reading an Inputstream received after a connection has been established (throught a Socke connect) between a Server ands a Client , messages are being lost when a wait method is call. A client sents message which have to be processed and response sent back to the client . The message are encoded and as the code below shows each message ends with a '":" .Not only one message is sent at a time. and when messages are sent the client sometimes expect replies. This means that when a message is read , it be being processed by a Processor and until the reply has be sent this the thread reading the messages has to wait. when a reply is sent and the thread is waken up, the remaining the messages in the Input stream gets lost but the loop is not also exited since the end of the file is never reached.
Solution:
1. read a command message. if you find end of message, process the message and wait until you are notify and continue with the next command line
public class Sender extends Thread {
private Socket socket;
private Processor processor = newProcessor();
private boolean DEBUG = false;
public Sender (Socket socket) {
super();
this.socket = socket;
start();
public void run() {
while (true) {
if (processor .getStateOfProcess()&& socket != null) {
InputStream input = null;
try {
input = socket.getInputStream();
if (processor .dispatchMessage() != null) {
socket.getOutputStream().write(
CacheManager.dispatchMessage());
processor .ClearMessage();
} catch (IOException ex) {
int i = 0;
char oldChar = ' ';
char c = ' ';
StringBuffer buffer = new StringBuffer();
try {
while ((i = input .read()) != -1) {
c = (char) i;
buffer.append(c);
if (c == ':' && oldChar != '\\') {
processor .process(buffer.toString());
buffer = new StringBuffer();
c = ' ';
try {
synchronized (this) {
wait();
} catch (InterruptedException e1) {
if (processor.dispatchMessage() != null) {
socket.getOutputStream().write(
CacheManager.dispatchMessage());
processor.ClearMessage();
oldChar = c;
} catch (IOException e) {
public void wakeup() {
synchronized (this) {
notify();
} This thread leaves that wait when the wakeup method is called in the Processor class.
Question
can some one help me figure out way and where the messages are being lost after the first message has been processed. why can the other message not be seen even other messages are still sent.
What can be a possible solution
thanksI didn't follow all of that, but I can see one serious error in your concurrent. You should always test the condition you're waiting for inside the synchronized block - otherwise you can't be certain that wait() is called before the corresponding notify() / notifyAll() call.
-
About JtextField and JButton problem
hi, I dont know how to make this, hope to get help:)
I wanna like this:
A JtextField object -- for user to input some Integer
A JButton -- when users click the button, the content in JtextFiled will be delivered to a variable (say, int a, sent to this "a")in my program.
Here, We dont need to check the content if it is Integer or not for simple.
Any idea for me? thanks!Write a listener class that implements listener interface. in that class implement the actionPerformed method of the super interface as u need.( I.e assign the value to the variable). Then bind this class with ur button using addActionListener() method( look in API).
ex:
bottonName.addActionListener( new ActionListener()
public void actionPerformed(ActionEvent e)
var = textarea.val;
});
Maybe you are looking for
-
I've done something to the desktop display such that the view is now too big for the screen. So, I have to scroll to get to the doc and all of the windows are too big (like Safari). How do I fix this?
-
Hello, I'm currently trying to learn some FXML and have at least 4 problems with the TableView component: 1) TableView shows some strange behavior after maximizing the window: https://dl.dropbox.com/u/1030857/maximized.PNG and minimizing it afterward
-
found out i couldnt watch a live stream coference because apple wont allow to download adobie flash player. why is this and is there a way around it to be able to catch more of live stream in future.?
-
Hi Could anybody tell me if the Developer guide provided by Oracle is sufficient to learn SOA 11g.(Mediator, B2B)? Or if any good book we can follow. I worked on SOA Suite 10.1.3. Coul you please give me the link where I can find good information reg
-
HT201210 error 3014, can't restore iPhone after updated the new version of itune
after updated the new version of itunes, my iphone can't back up and restore. Why everytime update the new version of itunes have problem????